• Welcome to Jose's Read Only Forum 2023.
 

Msxml2.ServerXMLHTTP.6.0 returns invalid URL in windows 7

Started by Douglas Martin, February 06, 2017, 08:16:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Douglas Martin

My  PB WIN application using IServerXMLHTTPRequest to communicates with credit card readers.  On windows 10 machines it works fine,  but on Windows 7 and XP machines the "objHTTP.Open Verb, bstrURL" returns and invalid URL.  I finally figure out if you put a "/" at the end of the URL it works on all the OSs. 

I have another application where the URL  has a ? followed a parameter string of characters and that data has an LRC value at the end so I cannot  just add a "/" to the end because the machine is expecting the ending value to the the LRC.

Does anyone have any suggestions for how to fix this issue with WIndows 7?

'Function PaxEMVXCall(ByVal Req As String) AS String
Local RV&,EdStr$,EdStrNew$,F%,hFil&
   EdStr$=PAXFormatRequest2Txt(Req)
   Local objHTTP AS IXMLHTTPRequest
   Local bstrURL AS WSTRING
   Local bstrResponse AS WSTRING
   Local vXML AS Variant
   Local Verb As String
   Local XMLStr As String
   Local lResult As Long
   Verb = "GET"
   objHTTP = NEWCOM "Msxml2.ServerXMLHTTP.6.0"
   IF ISNOTHING(objHTTP) THEN
     'Call PTTrace("PAXRequest objHTTP is Nothing")
     EXIT FUNCTION
   End If   
   ' Opens an HTTP connection to an HTTP resource
   bstrURL = "http://"+CreditServerAdd+":"+Trim$(Using$("#####",CreditServerPort))
   Call PTTrace("Open bstrURL="+bstrURL)     
   Call PTTrace("Req="+Req)     
   bstrURL = bstrURL+"?"+Get_Base64_Encode(Req)
   Call PTTrace(" bstrURL=<"+bstrURL+">")
   objHTTP.Open Verb, bstrURL
   ' Sends an HTTP request to the HTTP server
   lResult& = OBJRESULT   
   objHTTP.Send(vXML)
   lResult& = OBJRESULT   
   IF objHTTP.Status = 200 THEN ' HTTP_STATUS_OK=200
      bstrResponse = objHTTP.ResponseText + "<>" + STr$(objHTTP.Status) + "<>" + objHTTP.StatusText
   ELSE
      bstrResponse = objHTTP.ResponseText + "<>" + STr$(objHTTP.Status) + "<>" + objHTTP.StatusText
   END If
   XMLStr = bstrResponse
   Function  = bstrResponse
End Function




Doug