B4J Question Help with SOAP in B4J

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am having a issue trying to send a SOAP request.
I am using a Non-UI Application.

I can't say I have ever done SOAP messages/requests before so I am learning as I work on this.

The following is the code I am using:
(I removed the IP from the code I posted)

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

The error I am getting is:


I guess I am doing something wrong..

Anyone know what I have done wrong ?
 

aaronk

Well-Known Member
Licensed User
Longtime User
Thanks for the reply.
Didn't realise that I needed to use those 2 modules rather than the library that I was using.

When I use it I am getting this error:


Any ideas on what is causing this to happen ?
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
This means that the SSL certificate is not recognized.
Any idea on how to make it so that it is recognized ?

Is this a SSL certificate error or just that B4J (Java) doesn't like the certificate that it received ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…