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"/>


3 comments:

Sabir said...

Hi George,
I'm trying to pass Custom header attribute to the SOAP Header in BPEL 11.1.1.7







Added the following the in BPEL

Added the below to the composite.xml

DatabaseInstanceId

SOAPUI Header message which works..




XCCCC
XXXXXX


2


Do you know how we can pass this through.. I would appreciate your help or insight on this issue..

Sabir said...




i
C


2


We need to pass the DatabaseId to the SOAP Header
Can you please let me know how this can be passed in BPEL..

Unknown said...

You can create a custom variable which has all the header contents. Then assign it as the header variable in invoke activity