Web Services
From SugarCRM Wiki
SugarCRM provides a web services interface using SOAP (Simple Object Access Protocol)
Contents |
Sugar SOAP Introductions and References
- SOAP Intro and Practical Examples (php)
- Sugar 5.5 Web Services - Design Overview Document (doc) view as HTML
- Developer Guide 5.2 'Web Services' section
SOAP Operations References
- SOAP Operations could be a wiki page describing the operations (if someone wrote it)
- See 'Finding the SOAP URLs and WSDL' below for details of how to see a list of operations available to you as listed in the WSDL
- SugarSoapUsers.php is source code file which lists operations and includes documentation comments on each of the SOAP operations appearing there as functions. HTML docs can be generated from these. Example generated docs
Tutorials
- Tutorial: http://www.sugarforge.org/frs/download.php/216/SugarCRM_SOAP_Overview.rtf (a little dated, March 2005)
- Good intro to using Sugar's SOAP API: http://www.beanizer.org/index.php3?page=sugar1
- Getting Started with SugarCRM SOAP API http://systemsconsciousness.com/2009/04/10/sugarcrm-soap-examples/
- Google Charts and SugarCRM SOAP http://systemsconsciousness.com/2009/08/13/sugarcrm-soap-examples-pt-2/
- Tutorial on SugarCRM and Perl via SOAP: http://enricosimonetti.com/2009/10/21/integration-between-sugarcrm-and-perl-using-soap/
SOAP support in various languages
In theory you could implement an external app in any language that has a SOAP library, from C++ all the way to Perl and from Python to Ruby. The complexity of the task lies not in the protocol, but your knowledge of the language, and the toolkit or library of your choosing. I've dabbled with Ruby, but I feel more at home with PHP, so it's mostly what I'll post here, if anyone uses another language, please post away.
So, some notes by programming language:
- SOAP in PHP
- SOAP in RUBY
- SOAP in Python
- SOAP in Java
- SOAP in CSharp
- SOAP in VB
- SOAP in ASP using VBScript
Finding the SOAP URLs and WSDL
All SOAP calls into Sugar use soap.php as their entry point. There are several SOAP APIs at this point. The original API implementation is actually in soap.php. This API has been deprecated. All new development should use the APIs located in the soap subfolder of your installation.
- SoapSugarUsers.php -- Should be used for single user connections. This is the primary API and is able to control all bean types. The Sugar Plug-in for Microsoft Outlook uses this API.
- SoapPortalUsers.php -- Should be used for portal applications. Sugar Portal uses this API.
- SoapSync.php -- Should be used for bulk data transfer and getting lists of recent changes.
SoapSugarUsers.php has been updated to have JavaDoc comments in the code. This should help developers leverage the API and speed the development process.
There are also a whole bunch of soap test files in the examples folder. Look under examples for all files that start with soap.
Take a working URL to a sugar server:
https://demo.sugarondemand.com/sugarcrm/index.php
Remove index.php and everything to the right of it. Replace with soap.php
https://demo.sugarondemand.com/sugarcrm/soap.php?wsdl
This will work on any server. If you want to get information from the latest wsdl from our demo servers, please use the following URLs:
https://demo.sugarondemand.com/sugarcrm/soap.php?wsdl https://demo.sugarondemand.com/sugarcrm/soap.php#
SOAP Interface Internals
Internally on the server side, the SOAP interface is implemented with nuSoap, a PHP SOAP library.
