Skip to Content

Prologue:

There was a time when I used to use XML Spy trial versions to help me test my SOAP scenarios. Then one day someone recommended SOAPUI. I fell in love…..

Chapter 1: A Disclosure

Most of us use SOAPUI as a test tool for testing Sender SOAP scenarios in PI. Whenever someone wants to simulate a SOAP all into PI, we are happy to recommend SOAPUI or XMLSpy as a testing tool. But then what about a SOAP receiver?

There are situations when there is an ongoing interface build. Lets say in this particular case, the requirement is that PI will be invoking a WS call to an application.The WS team has shared the WSDL to the PI team but they have not yet shared the target URL since they are building the application logic in parallel and hence the WS is not yet hosted. So hard working consultants as we are, we end up finishing our build but the dilemma of unit testing lingers around. I never knew this before but seems this is where SOAPUI can help us again.

Many of you might already know this feature but some ignoramus human such as me might still be left in the dark. Hence hope this blog will be of help to many of those getting bored in that darkness.

Chapter 2: Mock a Service

There is a cool feature in SOAPUI that lets you run or mock a Web Service. In short, you can replicate the functionality and run the web service on your desktop.

/wp-content/uploads/2010/10/29oct2010_1_113318.jpg

Once you load the WSDL as a project, you can use the option Generate MockService.

You can select the particular operation, provide the path (which will result in your Target URL) and the port

/wp-content/uploads/2010/10/29oct2010_2_113319.jpg

Once you have the Mock Service setup, you can edit the response of the operation to whatever value that you may desire.

/wp-content/uploads/2010/10/29oct2010_3_113320.jpg

Setting up the mock response from the Web service:

/wp-content/uploads/2010/10/29oct2010_4_113321.jpg

Once the response is setup, we can start the mock service which will run on the local machine.

/wp-content/uploads/2010/10/29oct2010_5_113322.jpg

All you now need to do is update the SOAP receiver adapter with the Target URL.

The target URL will be http://* :8080/<path defined when creating the mock service>

Run your scenario and you will find a synchronous response coming back to PI from your mock service.

SXMB_MONI:

/wp-content/uploads/2010/10/29oct2010_6_113323.jpg

Well, I hope this information sure does help you 🙂

To report this post you need to login first.

18 Comments

You must be Logged on to comment or reply to a post.

  1. Trevor Naidoo
    Shabz, SoapUI has slowed down the process of my hair starting to grey very early 🙂
    And I’ve only just scrathed the surface with it.

    It’s the most awesome tool & I hope it grows from strength to strength!

    Regards, Trevor

    (0) 
  2. Tim Drury
    soapUI is a great tool; I’ve been using it since before 2.0.  We frequently develop both unit tests and integration tests of our web services in SAP ME with it.  Then, you can execute those tests via Hudson – a continuous build server.  The Groovy-scripting capabilities let you create some complicated integration tests.
    (0) 
  3. Todd Hensley
    I have not yet used it to mock a service, but whenever somebody tells me I am going to be calling a service, soapUI is the first thing I fire up.  Perfect for “exploring” a service you haven’t called before.  Also great for testing new services that you’ve written.
    (0) 

Leave a Reply