Solved
This is an example how to call a public web service in order to add two numbers, key parts are: The Envelop, The end point and the Content Type, I figure out the content type reading outputs using SOAPUI.
Thanks very much for all of your help with my previous issues.
Best Regards
Virgilio
The end point
http://www.dneonline.com/calculator.asmx
The envelop (saved as request.xml in DirAssest - it add two numbers 6 and 5)
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>6</tem:intA>
<tem:intB>5</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
B4J Code
Best Regards Virgilio
This is an example how to call a public web service in order to add two numbers, key parts are: The Envelop, The end point and the Content Type, I figure out the content type reading outputs using SOAPUI.
Thanks very much for all of your help with my previous issues.
Best Regards
Virgilio
The end point
http://www.dneonline.com/calculator.asmx
The envelop (saved as request.xml in DirAssest - it add two numbers 6 and 5)
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>6</tem:intA>
<tem:intB>5</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
B4J Code
B4J Code:
Sub AppStart (Args() As String)
Log("Hello world!!!")
Dim job As HttpJob
job.Initialize("Job", Me)
Dim msg As String = File.ReadString(File.DirAssets, "request.xml")
Log(msg)
job.PostString("http://www.dneonline.com/calculator.asmx", msg)
job.GetRequest.SetContentType("text/xml")
StartMessageLoop
End Sub
Public Sub JobDone (Job As HttpJob)
If Job.Success = True Then
Log("Webservice Correct Correct")
Log(Job.GetString)
Else
Log("Error Webservice")
Log(Job.ErrorMessage)
End If
Job.Release
ExitApplication2(0)
End Sub
Best Regards Virgilio
Last edited: