Wednesday, January 21, 2015

Salesforce WebService Using SOAP UI

Testing Salesforce Webservice through SOAP UI 


 Salesforce provides the ability to expose apex classes to external system through webservices.
 How to create a webservice class (Link to another Post)
Once we have created a webservice we need to test the web service through an external system. SOAP UI is a best tool to test any web service.


 STEP 1:- Generate an Enterprise WSDL from the salesforce org you want to test the web service. And Import the WSDL in SOAP UI.


STEP 2:-
Generate the WSDL for the web service class.And Import the WSDL in SOAP UI. Under different project Name.


STEP 3:-
In order to make a  web service call  from soap UI to Salesforce we need a session ID. We can get the session id by using the pre-defined Login Method.This method is available under SoapBinding tag for the project which we created while inporting Enterprise WSDL.





STEP 4:-

Getting Response for Login method and getting session ID. Delete the <soapenv:header> tag and provide the username and password in the request section. Press the Green button to make the request.Once the call succeeds we get the session Id which can be used in our web service call to test the webservice.


Image Missing

Response



In the same way we will be getting our response from the salesforce webservice class.



No comments:

Post a Comment