Hello,
i want to call a simple function (HelloWorld) inside my webservice (Service.asmx):
unfortunately i get an Exception: org.apache.http.client.ClientProtocolException.
My Question: is this the right way to call a webservice?
What am I doing wrong?
Thanks in advance & Greetings ... Kiffi
i want to call a simple function (HelloWorld) inside my webservice (Service.asmx):
B4X:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
HttpClient1.Initialize("HttpClient1")
End If
Dim URL As String
URL = "http://192.168.1.37:8023"
Dim XML As String
XML = ""
XML = XML & "<?xml version='1.0' encoding='utf-8'?>"
XML = XML & "<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'>"
XML = XML & " <soap12:Body>"
XML = XML & " <HelloWorld xmlns='http://my.webservicetest.org/' />"
XML = XML & " </soap12:Body>"
XML = XML & "</soap12:Envelope>"
XML = XML.Replace("'", Chr(34))
Dim request As HttpRequest
request.InitializePost2(URL, XML.GetBytes("UTF8"))
' POST /Service.asmx HTTP/1.1
' Host: 192.168.1.37
' Content-Type: application/soap+xml; charset=utf-8
' Content-Length: length
request.SetHeader("POST", "/Service.asmx HTTP/1.1")
request.SetHeader("Host", "192.168.1.37")
request.SetHeader("Content-Type", "application/soap+xml; charset=utf-8")
request.SetHeader("Content-Length", XML.Length)
request.Timeout = 10000
If HttpClient1.Execute(request, 1) = False Then Return
ProgressDialogShow("One moment please...")
End Sub
unfortunately i get an Exception: org.apache.http.client.ClientProtocolException.
My Question: is this the right way to call a webservice?
What am I doing wrong?
Thanks in advance & Greetings ... Kiffi