Hi all,
I'm new of the forum but 1 years old licensed user of B4A
My problem: i'm trying to call a SAP Web Service by b4a application using httputils2 library.
My code:
All the code is executed correctly but in job.getstring i've the WSDL xlm file as result..
The result of my webservice is getting a string as return (ex: "hello world")
The request SOAP XML is generated by SAP.
This is the expected result:
Any suggestion?
I'm new of the forum but 1 years old licensed user of B4A
My problem: i'm trying to call a SAP Web Service by b4a application using httputils2 library.
My code:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim sidij As HttpJob
Dim url As String
Dim lblText As Label
Dim scvText As ScrollView
Dim txt As String
Dim requestSoapXML As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LongText")
scvText.Panel.LoadLayout("LongText1")
url = "http://10.1.1.4:8000/sap/bc/srt/wsdl/flv_10002P111AD1/sdef_url/ZWEB_MC_TEST?sap-client=100"
requestSoapXML = "<?xml version=""1.0""?> <n0:ZwebTest xmlns:n0=""urn:sap-com:document:sap:soap:functions:mc-style""/>"
Log("Imposto il messaggio di richiesta:")
Log(requestSoapXML )
sidij.Initialize("Job", Me)
sidij.Username = "user"
sidij.Password = "pass"
sidij.poststring(url, requestSoapXML)
sidij.GetRequest.SetContentType("text/xml; charset=""UTF-8""")
ToastMessageShow("un momento ...", True)
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Log("Risultato su job.getstring:")
Log(Job.GetString)
txt = ""
txt = txt & Job.GetString
lblText.Text=txt
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
All the code is executed correctly but in job.getstring i've the WSDL xlm file as result..
The result of my webservice is getting a string as return (ex: "hello world")
The request SOAP XML is generated by SAP.
This is the expected result:
B4X:
<?xml version="1.0" encoding="UTF-8"?>
<n0:ZwebTestResponse xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
<OMsg>Forse funziona!</OMsg>
</n0:ZwebTestResponse>
Any suggestion?