Showing posts with label Web Service Services. Show all posts
Showing posts with label Web Service Services. Show all posts

Saturday, 12 January 2013

Handling SelectionFailure Fault in Assign activity for missing elements


SelectionFailure is a common fault that occurs when an element is missing and you are trying to assign it to target element.
It is possible that the source element might actually be an optional element in
the input document and the XML element marker being in square brackets will indicate this is an optional element.
Open an assignment that causes selectionFailure faults when an element is not present
in the input.
Right-click to the left-hand side of the assignment that causes the selectionFailure fault and select the ignoreMissingFromData.This will cause the assignment to be ignored if the source element does not exist

When the ignoreMissingFromData attribute is set on a copy statement in Assign,
it causes that copy statement to be skipped if the from query were to cause a
SelectionFailure fault.



Friday, 28 December 2012

REST services in SOA 11g using HTTP Binding

Invoking REST services in SOA 11g using HTTP Binding 

If you want to invoke HTTP methods like GET or POST in SOA composite application for that HTTP Binding Adapter is available that can be use to invoke REST services. For example if you have a web application that has a servlet that takes HTTP GET request with some parameter and returns an XML response.

So here I am demonstrating with an example. Create a SOA project with empty composite

Create an sample xsd

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
            elementFormDefault="qualified">
  <xsd:element name="Request">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="FName" type="xsd:string"/>
        <xsd:element name="LName" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="Response">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Name" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Drop a Http Binding adapter in exposed services name it HttpTest click next in HTTP Binding Configuration.









 

 

 

 

Here you can specify type as service or reference, service type one way or request response, operation name and type of HTTP GET or POST.
In Request message either you can select existing element from a schema or select the wizard to create it .

 
Create a bpel process with Define Service later template


 
Wire service and bpel process


 
In Bpel process drop a receive activity with create instance checked and connect it with partner link


 In assign activity use concat function to assign name to output variable.

Deploy the application and for test through web browser

EndPoint- http://localhost/soa-infra/services/default/SampleHttp/HttpTest
Then request parameter FName and LName
operationName=Request-Response