About the SOAP Web Services

3 minute read time.

In another article as in this article I would like to consider the SOAP based Web Services for Sage CRM.

The SOAP based web services are very important because they are available to all currently supported versions of Sage CRM and they offer full CRUD (Create, Read, Update and Delete) functionality to developers.

The SOAP interface is available for installations of Sage CRM what ever the license key and so there is not additional cost implication for using the SOAP based web services.

SOAP is an XML based protocol for exchanging information between systems over the web. And another important term that needs to be known is WSDL. The Web Services Description Language (WSDL) is an XML format that Sage CRM uses to publish the Object Types and Methods that are exposed by Sage CRM. SOAP and WSDL are industry standards are by no means special to Sage CRM but what is defined using them is unique to Sage CRM.

The diagram below shows the basic conversation that might happen between a remote application and Sage CRM.

The application makes a request over the web (HTTP or HTTPS) in the form of an XML message. This message is formatted in the SOAP standard and contains a structure that conforms to what the WSDL expects.

An example message might look like this:

[code language="xml"]

133940176131748




user_logon = 'Admin'
Users



[/code]

Sage CRM recieves the message and then unpacks it. Depending on the message it will then query the database or insert or update data as necessary and build the response. Any HTTP request will get a response and the response from Sage CRM will be formatted as a SOAP message:

[code language="xml"]


15AdminAdministratorSystem
US
IS353 1 612 34563456086 803 4099
353 1 612 [email protected]:12:462010-12-13T11:12:4603333334System Admin322FalseFalseTrueTrueNot Resource112TrueWorldwideUnrestricted ProfileTrueTrueTrueTrueTrue£TrueSystem AdminDublin5/234ANot TemplatetrueYes15Named1false
[/code]

What you can see from this is that the SOAP web services provide a mechanism for a remote application to interact with Sage CRM in order to read, create, update, or delete records for any exposed entity. This could be Companies, People, Opportunities, Cases, Quotes and Orders.

But the interface is only about data access. It does not provide users with a GUI, which is the case with the .NET and COM APIs. Instead, Web Services share business logic, data, and processes. A developers can add the web service to a GUI, such as a Web page or an executable program, to provide users with the required functionality.

The SOAP based web services are secure and easily controlled by the Sage CRM System Administrator.

The remote application has to log on as a user and a session is created that is monitored and stored in the user Activity tables as a clearly identifiable Web Service session.

The system administrator can choose which entity is exposed to Web Services.

The WSDL from Sage CRM can be used by any Integrated Development Environment (IDE) such as Visual Studio as a web reference which enables the exposed objects and methods to be available within the intellisense of the program. This makes programming with the Web Services a 'breeze' and Sage CRM provides an extensive set of C# snippets to speed the development process.

But a developer is not limited to any one programming language when working with the SOAP based Web Services. Any language capable of formulating a SOAP request can be used whether it is java or php. Furthermore the web services interface can be used to make AJAX (Asynchronous Javascript and XML) requests within the Sage CRM screens that allow an implementer to Mash-up new presentations of data within the screens.

If you would like to know more about the Web Services interface then a very good source of examples on how to code using the interface is found within the Hints, Tips and Trick partner blog within the the community. This is actually a public blog so everyone should be able to access this. https://community.sagecrm.com/search/SearchResults.aspx?q=web+services&ctypes=blog

There are other resources available for partners that include a sample application that demonstrates how to use the code, and a collection of C# snippets.

  • select comp_companyid,comp_name,rtrim(Phon_AreaCode)+rtrim(Phon_CountryCode)+Phon_Number from company

    join PhoneLink on PLink_EntityID = 5 and PLink_RecordID = comp_companyid

    join Phone on Phone.Phon_PhoneId = PhoneLink.PLink_PhoneId

    where rtrim(Phon_AreaCode)+rtrim(Phon_CountryCode)+Phon_Number = '6171720-1500'

    how can i put this query in ?