Author Topic: Msxml2.ServerXMLHTTP.6.0 returns invalid URL in windows 7  (Read 1757 times)

0 Members and 1 Guest are viewing this topic.

Offline Douglas Martin

  • Newbie
  • *
  • Posts: 22
  • User-Rate: +0/-0
    • ProfiTouch
Msxml2.ServerXMLHTTP.6.0 returns invalid URL in windows 7
« on: February 06, 2017, 08:16:33 PM »
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?

Code: [Select]
'Function PaxEMVXCall(ByVal Req As String) AS String
Local RV&,EdStr$,EdStrNew$,F%,hFil&
   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"
     'Call PTTrace("PAXRequest objHTTP is Nothing")
   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   
   lResult& = OBJRESULT   
   IF objHTTP.Status = 200 THEN ' HTTP_STATUS_OK=200
      bstrResponse = objHTTP.ResponseText + "<>" + STr$(objHTTP.Status) + "<>" + objHTTP.StatusText
      bstrResponse = objHTTP.ResponseText + "<>" + STr$(objHTTP.Status) + "<>" + objHTTP.StatusText
   END If
   XMLStr = bstrResponse
   Function  = bstrResponse
End Function