Showing posts with label SCA. Show all posts
Showing posts with label SCA. Show all posts

Tuesday, December 6, 2011

SOAP Version Mismatch Exception in SOA 11g


Recently one of the queries that was posted in the practice forum was regarding the SOAP version mismatch

Issue
----------------------------
Facing the below exception in client environment when an external client is invoking bpel service deployed on SOA Suite 11.1.1.4.

oracle.j2ee.ws.saaj.soap.SOAPVersionMismatchException: Mime Header Content-Type: text/xml requires SOAP envelope namespace: http://schemas.xmlsoap.org/soap/envelope/: Mime Header Content-Type: text/xml requires SOAP envelope namespace: http://schemas.xmlsoap.org/soap/envelope/

They tried the option of generating SOAP1.2 binding in the wsdl (i.e., open the wsdl in design mode and drag the ‘binding’ component on to the centre pallete, and choose the option of SOAP 1.2) and the WSDL file will have the namespace like http://schemas.xmlsoap.org/soap12/ which is still different from the namespace client is sending.


1.    When the SOAP 1.2 generated wsdl is opened in browser, only SOAP 1.1 namespace is visible. Is the SOA suite overriding SOAP 1.2 with 1.1? How do we enforce SOA suite to use SOAP1.2 namespace?

Solution
------------------
 The problem is due to version mismatch Client is expecting a SOAP 1.2 service where as we are exposing a SOAP 1.1 service. By default the Jdev created BPEL service will be using SOAP 1.1 .The way to change it is to mention a soap version as part of the service in composite.xml

In composite.xml, add the soap version for the exposed service and redeploy, it will start using SOAP 1.2 bindings. By default if soap version is not specified it uses soap 1.1.

sample code snippet of Composite,xml
---------------------------------------------------------
<service name="bpeltest1_client_ep" ui:wsdlLocation="BPELTest1.wsdl">
  </service>


Hope this helps in resolving the version mismatch issues accessing SCA composite services.

Wednesday, July 21, 2010

Decomposing Composite.xml –Part1

writera

In one of my previous blog, I had written on the different components that make up a composite (composite.xml). In this blog, I will try to go a layer deeper and disintegrate the composite.xml file to explain the different values that need to go into each attribute of the main element tags. This will be helpful in case you are writing your own composite.xml or trying to migrate from SOA10g versions to 11g. I will be concentrating more on the service and references tags in this write-up.

Service Element

Synchronous Service

First we will see how a synchronous service is represented in a composite.xml.

Sync Service XML Code snippet Template (Composite.xml)

<service name=" Service Name” ui:wsdlLocation=" URL of abstract wsdl " >

<interface.wsdl interface="[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the WSDL]"

<binding.ws port="[Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per WSDL]/[ Name of the Service Port as per WSDL])" location="[URL of the concrete WSDL]"/>

<service>

The attributes corresponding to each element is explained below.

1. attribute name in Service element = [ Sync service name]

2. attribute ui:wsdlLocation in Service element = [URL of the abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as given in the WSDL]

4. attribute port in binding.ws element = [Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as given in the WSDL]/[ Name of the Porttype as given in the WSDL]

5. attribute location in binding.ws element = [URL of the concrete WSDL]

For example::

<service name=" SyncEmployeeService " ui:wsdlLocation="oramds:/apps/geo/service/Employee/SyncEmployee.wsdl" >

<interface.wsdl interface="http://xmlns.geo.com/service/Employee#wsdl.interface(EmployeeRequest)"

<binding.ws port="http://xmlns.geo.com/service/Employee#wsdl.endpoint(SyncEmployeeService_ep/ EmployeeService_pt)"/>

<service>

Asynchronous Service

Now we will see how an Asynchronous service is represented in a composite.xml.

Async Service XML Code snippet Template (Composite.xml)

<service name=" Async Service Name” ui:wsdlLocation=" URL of abstract wsdl " >

<interface.wsdl interface="[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the WSDL]"

callbackInterface="[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Response PortType as per the WSDL]"/>

<binding.ws port="[Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per WSDL]/[ Name of the Request Service Port as per WSDL])" location="[URL of the concrete WSDL]"/>

<callback>

<binding.ws port ="[Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per WSDL]/[ Name of the Response Service Port as per WSDL])" />

</callback>

<service>

1. attribute name in service element = [Async service name]

2. attribute ui:wsdlLocation in service element = [URL of the abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as given in the WSDL]

4. attribute callbackInterface in interface.wsdl element =[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Response Port as given in the WSDL]

In case if you are not finding the response port of the service then wsdl.endpoint can be given as [Name of the Porttype element as given in the WSDL]_ep.

5. attribute port in binding.ws element = [Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as given in the WSDL]/[ Name of the Porttype as given in the WSDL]

6. attribute location in binding.ws element = [URL of the concrete WSDL]

For example ::

<service name="AsyncEmployeeService" ui:wsdlLocation="oramds:/apps/geo/service/Employee/AsyncEmployee.wsdl" >

<interface.wsdl interface="http://xmlns.geo.com/service/Employee#wsdl.interface(EmployeeRequest)"

callbackInterface=" http://xmlns.geo.com/service/Employee#wsdl.interface(EmployeeRequestCallback)"/>

<binding.ws port=" http://xmlns.geo.com/service/Employee #wsdl.endpoint(AsyncEmployeeService_ep/AsyncEmployeeService_pt)" location="” />

<callback>

<binding.ws port=" http://xmlns.geo.com/service/Employee#wsdl.endpoint(AsyncEmployeeService_ep/AsyncEmployeeService_pt)"/>

</callback>

<service>

Concrete WSDL URL for services deployed on SOA server

http://{host}:{port}/soa-infra/services/default)/[ Name of the Service as given in the attribute name of the element definition in the WSDL]/[Name of the Porttype element as given in the WSDL]?WSDL

References Element

Synchronous Reference

Now we will see how an Synchronous reference service is represented in a composite.xml.

Sync Reference XML Code snippet Template (Composite.xml)

<reference name="Sync Reference name" ui:wsdlLocation=" URL of Reference abstract wsdl " >

<interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0"

interface ="[Namespace of the Reference Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the Reference WSDL]”/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="[Namespace of the Reference Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per Reference WSDL]/[ Name of the Service Port as per Reference WSDL])" location="[URL of the Reference concrete WSDL]"/>

</reference>

The attributes corresponding to each element is explained below.

1. attribute name in Service element = [ Sync Reference service name]

2. attribute ui:wsdlLocation in Service element = [URL of the Reference abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Reference Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as given in the Reference WSDL]

4. attribute port in binding.ws element = [Namespace of the Reference Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as given in the WSDL]/[ Name of the Porttype as given in the Reference WSDL]

5. attribute location in binding.ws element = [URL of the Reference concrete WSDL]

For Example ::

Here the composite snippet which has an external reference to a Sync Person Service

<reference name="SyncReference" ui:wsdlLocation="oramds:/app/geo/references/SyncPerson.wsdl" >

<interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0"

interface="http://xmlns.geo.com/PersonService#wsdl.interface(PersonService)"/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="http://xmlns.geo.com/PersonService#wsdl.endpoint(PersonService/PersonService)"

location="http://host:port/soa-infra/services/default/PersonService/client?WSDL"/>

</reference>

Asynchronous Reference

Now we will see how an Asynchronous reference service is represented in a composite.xml.

Async Reference Service XML Code snippet Template (Composite.xml)

<reference name=" Async Reference Service Name” ui:wsdlLocation=" URL of Reference abstract wsdl " >

<interface.wsdl xmlns:ns=http://xmlns.oracle.com/sca/1.0

interface="[Namespace of the Reference Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the Reference WSDL]"

callbackInterface="[Namespace of the Service as defined in the Reference wsdl]#wsdl.interface[Name of the Response PortType as per the Reference WSDL]"/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="[Namespace of the Service as defined in the Reference wsdl]#wsdl.endpoint([Name of the Service as per Reference WSDL]/[ Name of the Request Service Port as per Reference WSDL])" location="[URL of the Reference concrete WSDL]"/>

<callback>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port ="[Namespace of the Service as defined in the Reference wsdl]#wsdl.endpoint([Name of the Service as per Reference WSDL]/[ Name of the Response Service Port as per Reference WSDL])"/>

</callback>

<reference>

1. attribute name in service element = [Asynchronous Reference service name]

2. attribute ui:wsdlLocation in service element = [URL of the Reference abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Service as defined in the Reference wsdl]#wsdl.interface[Name of the Request PortType as given in the Reference WSDL]

4. attribute callbackInterface in interface.wsdl element =[Namespace of the Service as defined in the Reference wsdl]#wsdl.interface[Name of the Response Port as given in the Reference WSDL]

In case if you are not finding the response port of the service then wsdl.endpoint can be given as [Name of the Porttype element as given in the Reference WSDL]_ep.

5. attribute port in binding.ws element = [Namespace of the Service as defined in the Reference wsdl]#wsdl.endpoint([Name of the Service as given in the Reference WSDL]/[ Name of the Porttype as given in the Reference WSDL]

6. attribute location in binding.ws element = [URL of the Reference concrete WSDL]

For Example ::

Here the composite has a external reference to a ASync Person Service

<reference name="AsyncReference” ui:wsdlLocation="oramds:/app/geo/references/AsyncPerson.wsdl">

<interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0"

interface="http://xmlns.geo.com/AsyncPersonService#wsdl.interface(AsyncPersonService)"

callbackInterface="http://xmlns.geo.com/AsyncPersonService #wsdl.interface(AsyncPersonServiceCallback)"/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="http://xmlns.geo.com/AsyncPersonService#wsdl.endpoint(AsyncPersonService/AsyncPersonService)"

location="http://host:port/soa-infra/services/default/AsyncPersonService/client?WSDL"/>

<callback>

<binding.ws port="http://xmlns.geo.com/AsyncPersonService#wsdl.endpoint(AsyncPersonService/AsyncPersonService)"/>

</callback>

</reference>

All the attribute values for services and references are similar, only the components as part of a service or reference vary from Synchronous service to asynchronous service to accommodate the callback mechanism. That’s pretty much for the day and month as I am going on vacation. NjoyJ

Thursday, May 6, 2010

more on SCA configuration file in SOA 11g

Introducing SCA

In this blog I will be explaining the basic structure and components involved in composite.xml which as you all know is the master configuration file of a composite application. This file uses an XML-based format called the Service Component Definition Language to describe the components and specify how they relate to one another. As you know in an increasingly SO world the interaction between components should be modeled as services, cleanly separating the implementation technology from the function that’s provided.

There are some terminologies that you need to be familiar when it comes to using the SCA model in SOA 11g.

The fundamental elements of a SCA SCDL are:

· Component

SCA defines a basic atom as a component. The implementation of each component can be done using any technology. Implementation.<tech> tag inside the <component> tag will specify the component used to implement that component. It can be BPEL, Mediator, Human Workflow, Java class, Business Rules or any other supported technology.

· Composites

Components can be combined into larger structures called composites. The composite.xml is used as the configuration file to define the composite application. It is defined using the SCDL language. (Service Component Definition Language)

· References

Whenever a component needs the services of other components it uses references. Each reference defines an interface containing operations that the component needs to invoke

· Bindings

Bindings specify how that communication happens. There can be multiple bindings, and the binding to be used will be determined at runtime.

· Wire

A reference is connected to a service using a wire. A wire is an abstract representation of the relationship between a reference and some service that meets the needs of that reference.

· Service

A composite can also expose one or more services. These services are actually implemented by components within the composite.

Code Snippet :: composite.xml

<composite name="MyExample" .>

<component name="Component1">

<implementation.bpel process="Process1"/>

</component>

<component name="Component2">

<implementation.java class="com.geo.HellloWorld"/>

</component>

<component name="RouteRequest">

<implementation.mediator src="RouteRequest.mplan" />

</component>

<component name="ManualApprovalTask">

<implementation.workflow src="ManualApproval.task" />

</component>

<component name="ManualApprovalRule">

<implementation.decision src="ManualApprovalRule.decs" />

</component>

<reference name="FileWrite" ui:wsdlLocation="FileWrite.wsdl">

<interface.wsdl interface="http://geo.com/FileWrite#wsdl.interface(Write_ptt)" />

<binding.jca config="FileWrite_file.jca" />

</reference>

<reference name="getStatus" ui:wsdlLocation="http://<host>:port/soa-infra/services/default/CCValidation!1.0/GetStatus.wsdl">

<interface.wsdl interface="http://geo.com/GetStatus#wsdl.interface(execute_ptt)" />

<binding.ws port="http://geo.com/GetStatus#wsdl.endpoint(GetStatusByCC/execute_pt)" location="http://host:port/soa-infra/services/default/CCValidation!1.0/GetStatus?WSDL" />

</reference>

<wire>

<source.uri>RouteRequest/FileWrite</source.uri>

<target.uri>FileWrite</target.uri>

</wire>

<service name=“ HelloWorld” ui:wsdlLocation="HelloWorld.wsdl">

<interface.wsdl interface="http://geo.com/recieveHello#wsdl.interface(execute_ptt)"/>

<binding.ws/>

<service/>

</composite>

The SCDL configuration file’s implementation element tells the runtime both what kinds of containers it needs for a particular composite and where to find the implementations of the components in that composite .The SCA runtime provides all bindings, allowing components created using any technology to use any available binding. Hope this helps J

Friday, September 5, 2008

why we need SCA?

WSDL has been a great step forward in terms of increasing connectivity and interoperability between applications. However, WSDL only focuses only on the interface of a service, and does not capture external service dependencies or policy configurations.

Service Component Architecture (SCA) provides a programming model for building applications and systems based on SOA. It is based on the idea that business function is provided as a series of services, which are assembled together to create solutions that serve a particular business need. SCA provides a model both for the creation and composition of services including the reuse of existing application function within SCA compositions. SCA goes a step beyond WSDL by defining both a service component and assembly model. A service component allows service developers to define not only the interface to a service but also the dependencies of a service on other services plus the policies associated with those interactions such as transaction, security, reliable delivery etc. and potential configuration knobs that a service might expose.

SCA does not interfere with how a service component is implemented. You can implement a service component in Java, BPEL, a rule language, etc. The SCA module allows a developer to assemble a set of service components, resolve reference dependencies and apply policies. This is a great step forward because current SOA platforms force developers to capture these references in either proprietary deployment descriptors or even worse hard code them into the service implementation itself.

SCA defines a framework that makes it easier for developers to implement Java service components including: annotation for converting a POJO into a service and annotation for asynchronous/session management. Oracle’s next generation.SOA infrastructure is based on SCA and will offer sophisticated means to compose applications, processes and assemblies, into transparent and easy to monitor solutions.

This blog is an excerpt from a White paper by Dave Berry
To know more about the components that make up SCA refer the article on SCA -Introducing_SCA