How To Use and Test SugarCRM Web Services using SOAPSonar

July 16th, 2010 by admin | Filed under SOA Tutorial.

Learn how to use and test SugarCRM web services WSDL-API via SOAPSonar Enterprise Edition, a .NET-based stand-alone testing tool.

Introduction
SugarCRM provides an extensive web services SOAP API for integration with external applications.  This article introduces how to use .NET-based SOAPSonar Enterprise Edition for invoking SugarCRM SOAP-API.  The following simple steps are required to get started:

▪  Install SOAPSonar Enterprise Edition published by Crosscheck Networks.
▪  Sign-up for SugarCRM evaluation License.
▪  Load WSDL published by SugarCRM
▪  Setup Operations, e.g., List Module Fields.

With these simple steps, you will be ready to integrate SugarCRM with any web services-aware application.  The web services API provided by SugarCRM is extensive, easy-to-use, and flexible.


Test Setup
To explore SugarCRM’s web services functionality, as shown in Figure 1, a simple test environment is setup with SOAPSonar installed on a client machine.  SOAPSonar consumes the WSDL-based API definition published by SugarCRM On-Demand hosted service.  This WSDL file provides all the necessary constructs for SOAPSonar
to send SOAP requests to SugarCRM over HTTP protocol.

Figure 1:  SugarCRM Web Services Invocation using SOAPSonar.

Figure 1: SugarCRM Web Services Invocation using SOAPSonar.

Installation Steps
The installation and setup steps are as follows:

1.  Download and Install SOAPSonar Enterprise Edition:  SOAPSonar is a web services testing client that consumes a WSDL and generates functional, performance, interoperability and vulnerability tests for a target web service.
With SOAPSonar, testing SugarCRM web services is easy and code free.  Download SOAPSonar Enterprise Edition.

2.  Register for a SugarCRM Professional On-Demand Trial Account:  You can also use the Live Demo version of the product with the following attributes:
a.  Live Demo URI:  http://demo.sugarcrm.com
b.  User:  will
c.  Password:  will

3.  Load SugarCRM WSDL:  Start SOAPSonar and load the WSDL from SugarCRM.  Figure 2 shows SOAPSonar with the WSDL loaded from location:

▪  http://demo.sugarcrm.com/sugarcrm/soap.php?wsdl

SOAPSonar parses the WSDL and in the left navigation panel, exposes the extensive list of operations provided by SugarCRM.  We can quickly test the SugarCRM web services interface by sending credentials using the “login”
operation.  Since SugarCRM expects MD5 values of the password, as shown in Figure 2, the MD5(HashString) Context Function is used with password “will” as the input HashString.  The Context Function menu is accessible by simply clicking at right side of the password field.

Figure 2:  SOAPSonar invoking SugarCRM login operation

Figure 2: SOAPSonar invoking SugarCRM login operation

On submitting the request (push the circled blue arrow), SugarCRM returns a SOAP Response, as shown in the lower right panel of Figure 2.  The SOAP Response contains the session id that will be used for invoking subsequent operations.

4.  Set Response Variable:  In this step, the session id obtained in the last step is passed in as a “Response Variable” for a selected operation.   To set the Response Variable:
a.  Select the Response Variable
b.  Select the variable of interest.  In our case, we are interested in the “id” element.
c.  Drag this variable to the bottom panel.  You will be prompted to set the variable name.  Use the default name “id”.

Figure 3:  Select “id” as Response Variable.

Figure 3: Select “id” as Response Variable.

5.  Assign Response Variable: In this step, the Response Variable “id” captured in the previous step is assigned as the input to the selected operation.   We selected the “get_module_fields” operation as shown in Figure 4.
a.  Click on the right side of the “session” field to provide Parameter Menu and navigate to Response Variable where you select “id” as an input to the session field.
b.  Push the Green Check button to save the values.
c.  Push the Blue Arrow button to run the test.

As seen in the lower Response Panel, the list of fields associated with the “Leads” Module is returned.

Figure 4:  Select “id” as Response Variable.

Figure 4: Select “id” as Response Variable.

Conclusions
Web Services are the foundations of modern distributed systems.   The widespread use of Web Services across network devices, applications, and corporate infrastructure mandates that CRM systems also expose their interfaces via simple
web services for WSDL/SOAP-based messaging for rapid integration.  Using SOAPSonar enables IT professionals to rapidly test integration paths with SugarCRM without extensive development.  With features such as operations chaining, developers and testers can quickly construct code-free test case sequences across WSDL operations exposed by SugarCRM.  Using a .NET-based testing tool further validates that the PHP-based web services exposed by SugarCRM are programming language independent and can be consumed by non-PHP clients.

References
1.  SugarCRM SOAP API Documentation
2.  Crosscheck Networks SOAPSonar Product Help.

   

Tags: , , , , , , , , ,

6 Responses to “How To Use and Test SugarCRM Web Services using SOAPSonar”

  1. Gebhard says:

    More and more emerging web services (especially data services) are REST conform, i.e. do not have WSDL descriptions.

    How will SOAPSonar cope with this fact?

  2. admin says:

    REST has its own service document like WSDL, it’s called WADL. In my experience using SOAPSonar, comparing with soapUI, it’s code free, far more feature rich and cover web services ,SOAP and XML testing and WS-* standards extensively.

    A couple of advantages that SOAPUI had over SOAPSonar, if we use WADL for REST testing, then go for SoapUI. They seem to be better at REST rather than SOAP.

  3. i envy you very much.

  4. triam says:

    will you please prepare same document with soapUI(open source)

  5. gupta says:

    really good……..

    can you please explain me the same thing thing with soapUI..

  6. I believe this is one of the such a lot significant information for me. And i am happy reading your article. But should observation on few basic issues, The web site taste is perfect, the articles is in point of fact nice : D. Good process, cheers

Leave a Reply