Wednesday, 23 May 2012

SOAP UI testing of REST Service / REST (Enabled)


 REST Service Testing


Friends!There was nothing much for me to write in this blog. In fact this is an extract from SOAP UI Pro documentation for  Testing REST Service. Quite Useful.



***At the end of this blog I have a snap shot of my first BPEL exposed as REST service tested via this tool.

 

Bottom of Form 1

SoapUI supports extensive testing of REST services and their resources, representations, etc. Let's start with a quick demo using the Google Maps API to get you started!

Start by creating a new project from the File menu and select the "Add REST Service" option:


 


Specify the following Google Map API URL in the Service Endpoint Field:


and be sure to select the "Extract Resource/Method" option. Pressing OK creates the REST Service in your project and prompts to create an initial REST Resource from the specified path:



Here you can just press OK, which finally creates the actual request and opens its editor. Press the green arrow at the top left in the Request editor and you can see the XML output returned by the service:


 


Now go back to the previous request and run it again:




 ***



BPEL Component as a REST SERVICE(using HTTP Adapter)



BPEL Component as  a REST SERVICE(using HTTP Adapter)



 
Task: To expose a SOA Component (a BPEL Service Here ) as a REST (HTTP based) service using HTTP Binding Adapter



  • Open A new Empty SOA Project.

  • Go to Composite.xml->Drop the HTTPBinding Adapter  from component pallet @ the left to to the Exposed Services Swimlane at the LeftHandSide


f9564-rest1


  • Follow the below screen shot to configure & complete the HTTP Binding Wizard.


  • You may use any schema for configuring the request and response Message structure withing the HTTPBinding .

     

    BPELProcess1.xsd

     

    <?xml version="1.0" encoding="UTF-8"?>

    <schema attributeFormDefault="unqualified"

        elementFormDefault="qualified"

        targetNamespace="http://xmlns.oracle.com/Application1/Project1/BPELProcess1"

        xmlns="http://www.w3.org/2001/XMLSchema">

        <element name="process">

            <complexType>

                <sequence>

                    <element name="input" type="string"/>

                </sequence>

            </complexType>

        </element>

        <element name="processResponse">

            <complexType>

                <sequence>

                    <element name="result" type="string"/>

                </sequence>

            </complexType>

        </element>

    </schema>



    • Step 1,Step2 and Step3 for HTTP Binding Wizard




5961d-rest7

 

 

 



  • Note:In HTTP Binding wizard Step 4:Verb and Payload-Type can be manipulated by manually edited in the composite.xml later and



ef949-rest3

 

 

 

Once The Adapter is configure for being exposed as a service.,


  • Drop an empty BPEL Process in the component area.

  • Open the BPEL and complete the desired flow using a receive and reply activity witha desired transformation between these .


 


878d3-rest4

 

To make available all the HTTP Methods for the service both GET and POST , composite so that HTTP Bindings comes with its default behavior remove the properties that appear in composite

9ecda-rest5

 

So that once deployed the composite , you have the blow shown methods available for invocation.


028cf-rest6