Showing posts with label SOAP. Show all posts
Showing posts with label SOAP. Show all posts

Tuesday, April 16, 2013

Passing custom soap headers in Invoke activity -SOA 11g


I had created a custom SOAP header to be passed in with the request, so while testing the service invocation passing in the soap security header the invocation was failing as the header was not getting passed properly. There is an issue with BPEL generated code for assigning the SOAP header. So you will need to manually change the headerVariable name to get it working.
I have used SOA PS4 environment.


   <soapenv:Header>
<geosec:UserTokenHeader soapenv:mustUnderstand="1" xmlns: geosec ="http://geo.com/geo-security">
         < geosec:UserSessionToken>xxxxxxxxxxxxx</ geosec:UserSessionToken>
         < geosec:TokenUserName>geotho</ geosec:TokenUserName>
         < geosec:ConsumerSystemId>MySystem</ geosec:ConsumerSystemId>
      </ geosec:UserTokenHeader>
      </soapenv:Header>

Add a SOAP header using the invoke Headers tab.


BPEL generated code
                     <invoke name="invokeStartSOAPProcess"
                          partnerLink="StartSOAPProcessService"
                          portType="ns17: StartSOAPProcessServicePType"
                          operation="startSOAPProcess"
                          inputVariable="startSOAPProcessMsgVar"
                          outputVariable="startSOAPProcessResponseMsgVar"
                          bpelx:invokeAsDetail="no"
                          bpelx: headerVariable ="SecurityHeader"/>

Need to change the headerVariable to  inputHeaderVariable

  Working code
                  <invoke name="invokeStartSOAPProcess"
                          partnerLink="StartSOAPProcessService"
                          portType="ns17: StartSOAPProcessServicePType"
                          operation="startSOAPProcess"
                          inputVariable="startSOAPProcessMsgVar"
                          outputVariable="startSOAPProcessResponseMsgVar"
                          bpelx:invokeAsDetail="no"
                          bpelx:inputHeaderVariable="SecurityHeader"/>


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, 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