Showing posts with label WSDL. Show all posts
Showing posts with label WSDL. 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.

Monday, July 18, 2011

JDev11g PS2 - XSLT designer limitations

There will be scenarios when you need to pass a counter variable /any status value into a transformation. Since Jdev 11g design supports multiple source transformation it’s easy to pass multiple variables as input into XSLT. The only issue that developers will encounter is the below error.

"Source parts of variables are either simple type or complex type, thus cannot be used to create mapper file".

1.    If you try to use a variable which is a simple type created in BPEL, it will through up this error.
Workaround
As a workaround you can create an element in XSD which is of complex type
XSD file code snippet

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.geo.com/test"
            targetNamespace="http://www.geo.com/test"
            elementFormDefault="qualified">
  <xsd:element name="loopCounter" type="CounterType"/>
  <xsd:complexType name="CounterType">
    <xsd:sequence>
      <xsd:element name="count" type="xsd:int" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

Create a variable in BPEL by using this element. This will work with XSLT designer.

2.    In case you are using a message type and the message type is added in a WSDL file which is not attached to any partner link, then the same error will occur.

WSDL file code snippet
<definitions targetNamespace="http://geo.com/test/"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="http://geo.com/test/"
             xmlns:tns1="http://www.geo.com/test"
             …………………….
/">
  <types>
    <xsd:schema targetNamespace="http://geo.com/test/types"
                elementFormDefault="qualified"/>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://www.geo.com/test" schemaLocation="xsd/test.xsd"/>
        </xsd:schema>
  </types>
 
  <message name="Counter">
        <part name="body" element="tns1:loopCounter"/>
    </message>

</definitions>

Workaround
 You will have to copy the types and message type definition to the WSDL file which is associated with any of the partner link present in the process. This is not a good practice as we are modifying the end system /interacting system wsdls, for internal use of the process flow.

So the best approach will be to use the first workaround as it is clean and neat and serves the purpose.

Tuesday, June 7, 2011

Avoiding invalid composites at server startup -Abstract V/s Concrete WSDL

One year back I got a chance to help a team working on AIA PIP migration project, the team was stuck with compilation issues of processes that gets migrated to 11g. All processes were using concrete WSDL of dependent processes which were not even ready. That’s when as a best practice we replaced all concrete WSDL’s with Abstract WSDL. Similar issue happens during startup of the server. While loading processes from MDS, there used to be issues related services being unavailable due to the order of process loading. That’s when much emphasis was laid on using Abstract WSDL compared to Concrete WSDL .A nice article on why Abstract WSDL need to be used instead of using concrete WSDL during design time and how it works @ runtime.

Wednesday, February 2, 2011

SOAP 1.1 Binding in WSDL @ SOASuite 11G


One of the queries which I got recently was on the SOAP bindings in 11g. The scenario is like this. The  SOA environment is 11g and it needs to integrate with OTM system. In 11g, by default the WSDL bindings uses SOAP 1.2 version for creating bindings. OTM system expects SOAP 1.1 version. 

The solution is simple. The Jdev provides options for creating different types of bindings in the design mode.
  1.   Open the wsdl
  2.   Go to Design Mode
  3.   In component Pallete there will be binding option
  4.   Drag and drop binding into the Bindings window of the Design page of WSDL.

5.                      A Create Binding pop-window will appear.You need to select the binding ,and SOAP 11 is listed as one of the options.
That’s it .You are done J