SOAP 1.1 or SOAP 1.2

jnbarban

Member
Licensed User
Longtime User
Hi, i call web services like that :

B4X:
Dim URL As String
   URL = "http://"& Main.gsServeurWebServices & "/WebServices/Mobiv.asmx"

   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 & "<GetReferences xmlns='http://" & Main.gsServeurWebServices & "/WebServices/Mobiv'>"
    XML = XML & "<Nom>" & txb_Nom.text.ToUpperCase & "</Nom>"
    XML = XML & "<Rue>" & txb_Rue.text.ToUpperCase & "</Rue>"
    XML = XML & "<CP>" & txb_CodePostal.text.ToUpperCase & "</CP>"
    XML = XML & "<Ville>" & txb_Ville.text.ToUpperCase & "</Ville>"
    XML = XML & "<Produit>" & MobivAndroid.GetCodeCombo(cbo_Produit,lst_Produit).ToUpperCase & "</Produit>"
    If rb_Reference.Checked = True Then
      XML = XML & "<TypeRecherche>R</TypeRecherche>"
   Else
      XML = XML & "<TypeRecherche>C</TypeRecherche>"
   End If
   XML = XML & "</GetReferences>"
    
   XML = XML & "</soap12:Body>"
   XML = XML & "</soap12:Envelope>"
   
   XML = XML.Replace("'", Chr(34))

   Dim request As HttpRequest
   request.InitializePost2(URL, XML.GetBytes("UTF8"))
   request.SetHeader("Content-Type", "application/soap+xml; charset=utf-8")
request.Timeout = 10000 
If HttpClient1.Execute(request, 1) = False Then Return
ProgressDialogShow("Recherche en cour...")

Work if i call WebServices on my PC but not if i call this webservices on my serveur...?


Do you know if my syntax "soap 1.2" could be the cause of my probleme?
 

dealsmonkey

Active Member
Licensed User
Longtime User
What error are you getting ? Also have you remembered to initialize the HttpClient1 ??
 
Last edited:
Upvote 0

jnbarban

Member
Licensed User
Longtime User
Yes , i have initialize HttpClient1.
When i call My Webservices on my serveur, the result is :

Error connecting: Internal Server Error500
 
Upvote 0

dealsmonkey

Active Member
Licensed User
Longtime User
Yes , i have initialize HttpClient1.
When i call My Webservices on my serveur, the result is :

Error connecting: Internal Server Error500

Can you show us the XML string that is being generated, I suspect an error there.

The way I have handled my webservices is to do all the data building on the server and just pass the parameters using a get from the device. On the server, I just then print the completed result and use the following to read the output

B4X:
Dim res As String
    res = Response.GetString("UTF8")

have a lok at http://www.purplecare.com/and/getgeo.php?Area=telford as an example. The only string building on the device is the url + the Area parameter. I am using a JSON response returned to the device.
 
Upvote 0

jnbarban

Member
Licensed User
Longtime User
This is the XML string send to my WebServices :


B4X:
<?xml version="1.0" encoding="utf-8"?><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"><soap12:Body><GetReferences xmlns="http://192.168.74.6/WebServices/Mobiv"><Nom>JOUAN</Nom><Rue></Rue><CP>45</CP><Ville></Ville><Produit></Produit><TypeRecherche>C</TypeRecherche></GetReferences></soap12:Body></soap12:Envelope>
 
Upvote 0
Top