cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid XML when calling B1WS LoginService

Former Member
0 Kudos

Hello,

I am trying to create a SOAP client that plugs into the SAP Business One Web Services interface (B1WS).  I've already used the SoapUI client to verify that the request document below works.  However, the following SOAP request (via my client) yields the following result.

Can anyone offer any suggestions as to the possible source of this problem?  It seems as though I am not initializing something properly in my SOAP client program (written using Ruby and the Ruby Savon library), but I'm not sure what the issue would be.

I would greatly appreciate any insights into this issue.  I know that my web browser exhibits similar behavior when I point my browser to the primary service at http://XXX.XXX.XXX.XXX/B1WS/Service.asmx in that the browser returns a similar Invalid XML error.  I have read that this behavior is to be expected and actually confirms that the DI-Server and the B1WS web environment are setup correctly (where XXX.XXX.XXX.XXX just represents the SAP server IP address).

Debug Information Below...

I, [2014-02-03T16:43:09.401283 #6934]  INFO -- : SOAP request: http://XXX.XXX.XXX.XXX/B1WS/Service.asmx

I, [2014-02-03T16:43:09.401662 #6934]  INFO -- : SOAPAction: "LoginService/Login", Content-Type: text/xml;charset=UTF-8, Content-Length: 685

D, [2014-02-03T16:43:09.401876 #6934] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:log="LoginService" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://www.sap.com/SBO/DIS"><soapenv:Body><log:Login><log:DatabaseServer>SAP1_NEW</log:DatabaseServer><log:DatabaseName>my_SAP_DB_name</log:DatabaseName><log:DatabaseType>dst_MSSQL2008</log:DatabaseType><log:CompanyUsername>my_SAP_username</log:CompanyUsername><log:CompanyPassword>my_SAP_password</log:CompanyPassword><log:Language>ln_English</log:Language><log:LicenseServer>XXX.XXX.XXX.XXX:30000</log:LicenseServer></log:Login></soapenv:Body></soapenv:Envelope>

D, [2014-02-03T16:43:09.403404 #6934] DEBUG -- : HTTPI POST request to XXX.XXX.XXX.XXX (net_http)

I, [2014-02-03T16:43:10.068417 #6934]  INFO -- : SOAP response (status 200)

D, [2014-02-03T16:43:10.068902 #6934] DEBUG -- : <?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Invalid XML</env:Text></env:Reason><env:Detail><ErrorList><Error>System Id = 202413416, Line Number = 1, Column Number = 40, Description = Expected an element name</Error></ErrorList></env:Detail></env:Fault></env:Body></env:Envelope>

Thank you,

Jonathan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Another point that I wanted to make on this question: 

I receive this error even if I pass in an invalid server name, or if the other company or SQL authentication parameters are wrong.  This tells me that the rejection occurs during the parsing of the XML request, but I just can't see any problems with my request document, especially considering that the SoapUI client works if I copy and paste the above request document, as long as I remove the leading <?xml version="1.0" encoding="UTF-8"?> portion first.

Maybe this additional clarification will help someone identify the issue...

Thanks,

Jonathan