Monday 26 December 2016

Exposing Endpoints in both SOAP1.0 and SOAP1.2 version in Oracle SOA Suite

Sometimes we want to expose SOAP endpoint URL in both SOAP1.0 and SOAP1.2 versions. In this blog, I am trying to explain how we can achieve it when we expose SOAP endpoints using Oracle SOA Suite.

The configuration to mention the version of SOAP is available in composite.xml file. Whoever worked on creating a SOA project using Oracle SOA Suite would know about composite.xml file, still I will take as an opportunity to explain what composite.xml mean and what it contains.

Composite.xml is an auto generated files which is like a master xml file. This file describes the entire composite assembly of services, service components, references, and wires. 

Composite.xml contains following parts

1. Defines composite name, version and namespaces
2. Importing dependent WSDLs
3. Defining list of services being exposed as an endpoints
4. Composite properties if any
5. Component implementation details
6. References detail of services being used by this composite
7. Wiring between service and components

If we observe the below composite.xml file, we could see the soapVersion attribute in <binding.ws> tag under <service> definition part in composite.xml. This is the one which will be referred by WebLogic server while deploying the composite application and appropriate SOAP service and binding information will be added dynamically to the WSDL document.  

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Generated by Oracle SOA Modeler version 12.1.3.0.0 at [11/24/16 10:38 AM]. -->

<composite name="ThrowingFaults"
           revision="2.0"
           label="2016-11-24_10-38-01_605"
           mode="active"
           state="on"
           xmlns="http://xmlns.oracle.com/sca/1.0"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
           xmlns:orawsp="http://schemas.oracle.com/ws/2006/01/policy"
           xmlns:ui="http://xmlns.oracle.com/soa/designer/"
           xmlns:sca-ext="http://xmlns.oracle.com/sca/1.0-ext">
  <import namespace="http://xmlns/ThrowMeFault"
          location="WSDLs/ThrowMeFault.wsdl" importType="wsdl"/>
  <service name="throwmefault_client_ep" ui:wsdlLocation="WSDLs/ThrowMeFault.wsdl">
    <interface.wsdl interface="http://xmlns/ThrowMeFault#wsdl.interface(ThrowMeFault)"/>       <binding.ws port="http://xmlns/ThrowMeFault#wsdl.endpoint(throwmefault_client_ep/ThrowMeFault_pt)" soapVersion="1.1"/>
  </service>
  <service name="throwmefault12_client_ep" ui:wsdlLocation="WSDLs/ThrowMeFault.wsdl">
    <interface.wsdl interface="http://xmlns/ThrowMeFault#wsdl.interface(ThrowMeFault)"/>
    <binding.ws port="http://xmlns/ThrowMeFault#wsdl.endpoint(throwmefault_client/ThrowMeFault_pt)" soapVersion="1.2">     
    </binding.ws>
  </service>
  <property name="productVersion" type="xs:string" many="false">12.1.3.0.0</property>
  <property name="compositeID" type="xs:string" many="false">cfeae6cc-91a3-4ef0-a143-be9a62514b5b</property>
  <component name="ThrowMeFault" version="1.1">
    <implementation.bpel src="BPEL/ThrowMeFault.bpel"/>
    <componentType>
      <service name="throwmefault_client" ui:wsdlLocation="WSDLs/ThrowMeFault.wsdl">
        <interface.wsdl interface="http://xmlns/ThrowMeFault#wsdl.interface(ThrowMeFault)"/>
      </service>           
    </componentType>
    <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
  </component>
  <wire>
    <source.uri>throwmefault_client_ep</source.uri>
    <target.uri>ThrowMeFault/throwmefault_client</target.uri>
  </wire>
  <wire>
    <source.uri>throwmefault12_client_ep</source.uri>
    <target.uri>ThrowMeFault/throwmefault_client</target.uri>
  </wire>
</composite>

If we do not mention the version of SOAP in composite.xml then the default one would be SOAP1.1.

1 comment: