Search code examples
phpsoapnusoapsugarcrm

XML error parsing SOAP payload on line 1: Mismatched tag


I am getting an error with nusoap and/or SugarCRM. Here is the error:

XML error parsing SOAP payload on line 1: Mismatched tag

I get that in the $soapclient->error_str response. Not exactly sure what this error means or where it is located and I could use some help. So here is the background, I am working in SugarCRM with the included nusoap class and have an external site accessing the soap interface. The weird thing is that I have working copy running locally and this error only occurred when I uploaded it to my linux server.

I now I have a low reputation but if you give a working answer I will accept it. And also, I have researched the error with no luck. Any help would be much appreciated. If you need me to post any code, just let me know.

MORE INFO:

I am using SugarCRM CE 6.2.1. My soap entry point is http://server/sugar/soap.php. Here is my instation of the nusoap client.

$soapclient = new nusoap_client('http://server/sugar/soap.php');

Here is an example of a call made to the soap client

$result = $soapclient->call('update_existing_contact', array($session_id, $data));

However the error is the same for every call.

Also I get the same error when I try to use the sugar/examples/SoapTest.php so I don't think it is the client.

Like I said earlier the thing that is the most weird is that the problem only occurs on my server even when it is the same code.


Solution

  • I would try to use e.g. SoapUI to test the web service. If that works, you know it's most likely a problem with the client. Some other suggestions for debugging

    • Look in the web server log (Is the call getting through OK)
    • Enable the SugarCRM logging and set the level to debug
    • Either enable PHP error output or make PHP log errors to a log file
    • Use e.g. SoapUI to test SOAP call
    • See question 5396302 for a thorough SOAP example
    • Check the SugarCRM SOAP documentation