Showing posts with label Aside. Show all posts
Showing posts with label Aside. Show all posts

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:




 ***



Thursday, 26 April 2012

Schematron Validation in SOA 11G Mediator


 


Schematron  Rule-based validation - Schematron.
This standard is available free on the ISO Publicly Available Specifications list. Paper versions may be purchased from ISO or national standards bodies.

Schemas that use ISO/IEC FDIS 19757-3 should use the following namespace:
http://purl.oclc.org/dsdl/schematron

Sample rule
Schematron rules can be created using a standard XML editor.

The following is a sample schema:

xmlns="http://purl.oclc.org/dsdl/schematron">
<pattern>
<title>Date rules</title>
<rule context="Contract">
ContractDate < current-date()">ContractDate should be in the past because future contracts are not allowed.
</rule>
</pattern>
</schema>

In Plain words:
This rule checks to make sure that the ContractDate XML element has a date that is before the current date. If this rule fails the validation will fail and an error message which is the body of the assert element will be returned to the user.

In markup languages, Schematron is a rule-based validation language for making assertions about the presence or absence of patterns in XML trees. It is a structural schema language expressed in XML using a small number of elements and XPath.

Schematron Validation in SOA 11G Mediator

  • The schematron validation allows loose coupling of Semantic validation of the incoming/outgoing mediator payload.This is accomodated while defining the routing rule for mediator payloads.



  • The Schematron file is created with a file type having an .sch extention.



  • This file can be maintained in  the project workspace or alternately as artifact in MDS repository for taking the real advantage of loose coupling of validation semantics.


In below example I have maintained the schematron file in my Mediator project work space.

when assertion (i.e. the asserted  test statement) evaluates to false, the asseted statement is thrown as validation error.

Deploy and test the Mediator from SOAP UI.