Sunday, July 24, 2011

MULE HTTP Web Service - Step7. Testing the service

We will be using Soap UI tool to send SOAP request to the server and validate them. You can download the Soap UI from http://www.soapui.org/

1. Create a new Soap UI project and provide the location of the ShippingService.wsdl. This would create the samples for each operation.

2. Validate GetShippingInfo functionality.

GetShippingInfoRequest:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ship="http://shippingservice.services.com">
   <soapenv:Header/>
   <soapenv:Body>
      <ship:GetShippingInfoRequest>
         <ship:confirmationNo>12</ship:confirmationNo>
      </ship:GetShippingInfoRequest>
   </soapenv:Body>
</soapenv:Envelope>

GetShippingInfoResponse:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <tns:GetShippingInfoResponse xmlns:tns="http://shippingservice.services.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <tns:orderNo>12</tns:orderNo>
         <tns:estimatedDeliveryDate>Sun Jul 24 09:23:45 CDT 2011</tns:estimatedDeliveryDate>
         <tns:currentStatus>In Processing</tns:currentStatus>
      </tns:GetShippingInfoResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

GetShippingInfo Soap Request

3. Validate OrderShipping functionality.

OrderShippingInfoRequest:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ship="http://shippingservice.services.com">
   <soapenv:Header/>
   <soapenv:Body>
      <ship:OrderShippingRequest>
         <ship:orderNo>1</ship:orderNo>
         <ship:price>100</ship:price>
         <ship:itemNo>498A</ship:itemNo>
         <ship:itemQty>2</ship:itemQty>
         <ship:shipmentType>EXPRESS</ship:shipmentType>
      </ship:OrderShippingRequest>
   </soapenv:Body>
</soapenv:Envelope>

OrderShippingInfoResponse:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <tns:OrderShippingResponse xmlns:tns="http://shippingservice.services.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <tns:confirmationNo>123</tns:confirmationNo>
         <tns:estimatedDate>Sun Jul 24 09:47:53 CDT 2011</tns:estimatedDate>
      </tns:OrderShippingResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

OrderShipping Soap Request

No comments:

Post a Comment