Hello to everybody!
I'm devolping with B4A till some month, it's a great tools!!
Now I have the need to send request to a soap web service.
This web service need to be call through a proxy on port 3100.
I tried to use this code, but the answer from the web service is an error of timeout, but the WS is on line. The proxy doesn't need user and password.
Where is my mistake?
Many thanks to everybody can help me!!!
Sub WSCall
Dim endPoint As String
Dim requestSoapXML As String
Try
endPoint = "https://blablablabla"
requestSoapXML="<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:ser=""http://services.api.blablablabla/"">" & _
"<soapenv:Header/><soapenv:Body><ser:Init><request>" & _
"<tid>11111111</tid>" & _
"<signature>ababababababababababababababababababa</signature>" & _
"<shopID>00</shopID>" & _
"<shopUserRef>mailzyz</shopUserRef>" & _
"<trType>AUTH</trType>" & _
"<amount>100</amount>" & _
"<currencyCode>EUR</currencyCode>" & _
"<langID>IT</langID>" & _
"<notifyURL>http://blablablablabla</notifyURL>" & _
"<errorURL>http://blablablablabla</errorURL>" & _
"<addInfo1></addInfo1>" & _
"<addInfo2></addInfo2>" & _
"<addInfo3></addInfo3>" & _
"<addInfo4></addInfo4>" & _
"<addInfo5></addInfo5>" & _
"</request></ser:Init></soapenv:Body></soapenv:Envelope>"
Log(requestSoapXML )
webRequestWS.InitializePost2(endPoint, requestSoapXML.GetBytes("UTF8"))
webRequestWS.SetHeader("Content-Type", "text/xml; charset=utf-8")
webRequestWS.SetHeader("SOAPAction", "")
webRequestWS.Timeout = 30000
GetWS.Initialize("GetWS")
GetWS.SetProxy("proxy.ws.xx",3100,"http") <------ Here I tried also Https, but nothing to do
If GetWS.Execute(webRequestWS, 1) = False Then Return
Catch
Msgbox("Error: " & CRLF & LastException.Message, "Error")
End Try
End Sub
I'm devolping with B4A till some month, it's a great tools!!
Now I have the need to send request to a soap web service.
This web service need to be call through a proxy on port 3100.
I tried to use this code, but the answer from the web service is an error of timeout, but the WS is on line. The proxy doesn't need user and password.
Where is my mistake?
Many thanks to everybody can help me!!!
Sub WSCall
Dim endPoint As String
Dim requestSoapXML As String
Try
endPoint = "https://blablablabla"
requestSoapXML="<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:ser=""http://services.api.blablablabla/"">" & _
"<soapenv:Header/><soapenv:Body><ser:Init><request>" & _
"<tid>11111111</tid>" & _
"<signature>ababababababababababababababababababa</signature>" & _
"<shopID>00</shopID>" & _
"<shopUserRef>mailzyz</shopUserRef>" & _
"<trType>AUTH</trType>" & _
"<amount>100</amount>" & _
"<currencyCode>EUR</currencyCode>" & _
"<langID>IT</langID>" & _
"<notifyURL>http://blablablablabla</notifyURL>" & _
"<errorURL>http://blablablablabla</errorURL>" & _
"<addInfo1></addInfo1>" & _
"<addInfo2></addInfo2>" & _
"<addInfo3></addInfo3>" & _
"<addInfo4></addInfo4>" & _
"<addInfo5></addInfo5>" & _
"</request></ser:Init></soapenv:Body></soapenv:Envelope>"
Log(requestSoapXML )
webRequestWS.InitializePost2(endPoint, requestSoapXML.GetBytes("UTF8"))
webRequestWS.SetHeader("Content-Type", "text/xml; charset=utf-8")
webRequestWS.SetHeader("SOAPAction", "")
webRequestWS.Timeout = 30000
GetWS.Initialize("GetWS")
GetWS.SetProxy("proxy.ws.xx",3100,"http") <------ Here I tried also Https, but nothing to do
If GetWS.Execute(webRequestWS, 1) = False Then Return
Catch
Msgbox("Error: " & CRLF & LastException.Message, "Error")
End Try
End Sub