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.

No comments: