Java CAPS 5 / 6, OpenESB, GlassFish ESB - Handling SOAP Headers in BPEL

Every now and then there arises a need to carry out-of-band information alongside the business payload but without disturbing or modifying it. Message Envelope Pattern is the Enterprise Integration Pattern label that is typically applied to solutions that address this issue. How the issue is addressed in practice varies depending on the technology in use. For JMS, for example, JMS Message Properties could be used to carry out-of-band information while the payload would be carried as the JMS payload. Web Services, typically using SOAP over HTTP, can address this requirement through the SOAP Header Extension Mechanism, whereby custom headers can be added to the SOAP Header while the payload is carried in the SOAP Body.

This document discusses construction of a WSDL that supports custom SOAP Header element and BPEL processes that are used to set and get custom header values in JBI and in eInsight. This mechanism is known to work in Java CAPS 5.x, Java CAPS 6 Classic and OpenESB / GlassFish ESB.

It is assumed that the reader is sufficiently familiar with the GlassFish ESB / OpenESB BPEL Service Engine and the SOAP/HTTP Binding Component, and / or Java CAPS Classic eInsight Business Process Manager and eDesigner IDE to be able to build projects without a step-by-step pictorial document.

The document is available here: 01_Handling_SOAP_Headers_in_BPEL_.pdf
The companion archive, containing WSDLs and projects, is available here: 01_Handling_SOAP_Headers_in_BPEL.zip

Comments:

This is a nice description!

I tried something similar some months ago, but in our case, it didn't work.
We wanted to get a header element (an Axis 1 session id) from a login operation to be able to pass it as header element to subsequent operation calls of the service.

Unfortunately, the response of the login operation in the original WSDL doesn't have any message parts, the only data is the session id returned in the header.

We could not bind the only message part of the modified WSDL to the header element, because the <body> element is mandatory. When its parts attribute is omitted, all message parts are bound to the body and thus cannot be bound to the header. When supplying a parts attribute, it must contain at least one message part name, which must be the newly added part that we intended to bind to the session id header element. As it is now bound to the body, it cannot be bound to the header.

:-(

We worked around this by copying the complete header from the login response to the requests of the subsequent operation calls, using the sun extension for the SOAP header (NMProperties).

Posted by Dirk Lattermann on August 06, 2009 at 11:23 AM EST #

Thanks for the good word, Dirk.
Alas, SOAP is fairly strict about the message structure. SOAP Header with no SOAP Body sounds like ebXML :-) I am glad, though, that you worked through the issue and got a solution to it.

Regards

Michael

Posted by Michael Czapski on August 06, 2009 at 12:18 PM EST #

Hello,

We are using the soap headers as described here.
It works fine. However this is the explicit way of using headers. This makes the
header mandatory.
That may generate some problems.

For example imagine two differet bpel modules A and B. Each one declares as a
partner the same WebService C. In A module, the wsdl of webservice C has a
header declaration for webmethode C1 (as in the example provided).
In B module, the wsdl of webservice C doesn't have a header declaration for
webmethode C1 (supposing in B environnement we don't need the information
provided in headers).

If you deploy A and B, when invoking C1 in A you get :
HTTPBC-E00799: Message denormalization failed
...................................................;
Caused by: com.sun.jbi.nms.wsdl11wrapper.WrapperProcessingException: The
normalized message contains MORE parts than are defined in the WSDL message
definition

If you deploy B and then A, when invoking C1 in B you get :
HTTPBC-E00799: Message denormalization failed
...................................................;
Caused by: com.sun.jbi.nms.wsdl11wrapper.WrapperProcessingException: The
normalized message contains LESS parts than are defined in the WSDL message
definition

A solution would be an implicit declaration of headers, see link below :
http://www.ibm.com/developerworks/xml/library/ws-tip-headers.html
Unfornunatelly you cannot adresse the header into the Bpel Editor as the invoke
activity has only input/output Variable parameters and no header.

Any solution for my problem?
Regards
Bogdan

Posted by Bogdan on April 26, 2010 at 03:11 PM EST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

In this Blog I post abstracts of articles / writeups / notes on various aspects of Java CAPS and SOA Suite including solutions, discussions and screencasts. The links to the referenced material are included in the bodies of the abstracts.

Search

Categories
Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today