SugarCRM SOAP API
The first thing to note is that the SOAP API for SugarCRM is advertised as being incompatible with the PHP 5 SOAP client implementation, and they recommend you use nusoap. However this isn’t true and I found it worked fine with PHP 5 in non-WSDL mode.
The second thing to note is that the documentation is rubbish. The best I could find is on their developer wiki and it isn’t enough to write an application with. I had to do a fair amount of fiddling around on the server side to understand when I was making mistakes which isn’t ideal for remote system calls! They do, however, have very good inline documentation so I ran PHPDocumentor over the file which had the stuff I was dealing with in it. I can’t find an equivalent online so you can see my copy over here
Also if you go to your own sugar installation and append /soap.php to the URL, you will see some information there about formats plus a link to the WSDL. The WSDL isn’t very human-readable but the top bit of it defines the custom data formats like “name_value_list” and shows you how to assemble them to submit to SOAP. If I can work out a good way of presenting that information I’ll add it somewhere and link to it.
There will also be a follow-up with the script that worked for me. If this helps, or you have any questions, then add a comment please :)
Hey Lorna,
Love that sugar api snippet – any chance of seeing some sweet raw code as I have to do something very similar…
Thanks, Richard
Richard: I’m in the middle of a post of the bits of code I used – will try to rustle something up for you!
Hey Lorna,
I am .Net developer, and I would like to know are these SOAP APIs exposed by SugarCRM, are compatible with data types which we use in .Net?
I am in the intension of integrating a .Net application with SugarCRM. Till now I could add the the proxy generated on the basis of WSDL to my .net app and could invoke the web methods exposed.
But then I am struck, and I need your help badly.
Hoping for your reply.
Gauri: Yes, this should all work with the equivalent .NET data types, because SOAP is designed to be an interface between systems. The basics (string, integer, array) will be used as you usually would in .NET and then the datatypes listed in http://lornajane.net/posts/2008/SugarCRM-SOAP-Data-Types should help you with the complex types. Good luck!
Fab, thanks Lorna! R
Richard: Try http://lornajane.net/posts/2008/SugarCRM-SOAP-API-Examples for size
Since SugarCRM only works with PHP5 in non-WSDL mode, I had to create all my calls from scratch. The SugarCRM documentation is somewhat minimal, as I may have mentioned, and I found I was mostly reading the WSDL to figure out how to format my SOAP calls.
Richard: And this (forgot I already had this as a draft!) http://lornajane.net/posts/2008/SugarCRM-SOAP-Data-Types
Thanks for those LornaJ, will check them out tomorrow if I have time or next week – owe you one!
R