Hi,
I originally had a issue trying to send a SOAP message/request but have now solved that issue. (https://www.b4x.com/android/forum/threads/help-with-soap-in-b4j.55088/)
Now when I send the request I am getting a error and the reply I am getting is as below:
Internal Server Error
Can't seem to work out where Line 1, Position 1 is?
The code I am using to send the request is as follows:
I do have the code working in VB.net but want to port it over to B4J since I have most of my other code working already in B4J, but if I can't solve the issue then I am going to have to port my B4J code to VB.net and give up with B4J and continue with VB.net.
I can't post my VB.net code in the forum but willing to send a PM to anyone that wants to help (serious people only please)
Anyone know where the error is happening ?
I originally had a issue trying to send a SOAP message/request but have now solved that issue. (https://www.b4x.com/android/forum/threads/help-with-soap-in-b4j.55088/)
Now when I send the request I am getting a error and the reply I am getting is as below:
B4X:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:...
Internal Server Error
Can't seem to work out where Line 1, Position 1 is?
The code I am using to send the request is as follows:
B4X:
'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Dim job1 As HttpJob
Dim requestSoapXML As String
requestSoapXML = "<?xml version='1.0' encoding='utf-8'?>" & _
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _
" <soap:Header>" & _
" <CredentialsHeader xmlns='https://xxx.xxx.xxx.xxx/test/API'>" & _
" <OrganizationID>1234</OrganizationID>" & _
" <Username>Admin</Username>" & _
" <Password>1234</Password>" & _
" </CredentialsHeader>" & _
" </soap:Header>" & _
" <soap:Body>" & _
" <ListAccounts xmlns='https://xxx.xxx.xxx.xxx/test/API' />" & _
" </soap:Body>" & _
"</soap:Envelope>"
job1.Initialize("JOB1", Me)
job1.PostString("https://xxx.xxx.xxx.xxx/Accounts.asmx", requestSoapXML)
StartMessageLoop
End Sub
Public Sub JobDone (Job As HttpJob)
If Job.Success = True Then
Log(Job.GetString)
End If
Job.Release
End Sub
I do have the code working in VB.net but want to port it over to B4J since I have most of my other code working already in B4J, but if I can't solve the issue then I am going to have to port my B4J code to VB.net and give up with B4J and continue with VB.net.
I can't post my VB.net code in the forum but willing to send a PM to anyone that wants to help (serious people only please)
Anyone know where the error is happening ?