SugarCRM uses
NuSOAP - SOAP Toolkit for PHP | Get NuSOAP - SOAP Toolkit for PHP at SourceForge.net to provide a SOAP interface, however, you can use the PHP SOAP functions to connect into it, which simplifies the version control and build process if the SOAP code will reside on a production server.
Key differences:
- NuSOAP uses a $soapclient->call('method',parameters) syntax, where PHP uses a $soapclient->method(parameters) syntax.
- NuSOAP encodes arrays, if you are using PHP, you must use a SoapVar, then create a SoapParam to pass it with the proper encoding.
- The values may be returned slightly differently. It's good to do a var_dump to view what is returned.
At the Sugar site, the documentation (
Sugar DeveloperZone - SugarCRM Developer Documentation, Sugar Documentation) posts some great code snippets (they're also in the source files under
examples).
Debugging the interface is much easier if you have access to both sides (server and client).
file_put_contents, or
error_log can be used to write debug information out during script execution to see what is happening.
If the Sugar SOAP server doesn't respond, it is often a parameter issue. Writing out the SQL, then running it directly through MySQL can be very helpful.
One final note - dumping the database out before beginning is extremely important. That way, if the database is corrupted, you can restore it quickly. Be sure to check the results through the application as you're working.