You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Lukasz L." <Lu...@sabre.com> on 2008/12/08 12:55:46 UTC

SOAP headers and CXF Provider

hello,

I have a few questions regarding behavior of CXF Provider in terms of SOAP
Headers:
1. If the NormalizedMessage that is sent to CXF Provider already contains
full SOAP envelope with SOAP headers will it be sent "as is" along with
these headers to the target service?
2. What is the other way to tell CXF Provider what SOAP headers headers
should it send? Are they taken from some NormalizedMessage properties? If
yes, what's should be the name of the property?
3. What does CXF Consumer do with SOAP headers when it has the flag
useSOAPEnvelope="false" and useJbiWrapper="false" ?

regards
Lukasz
-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20893998.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SOAP headers and CXF Provider

Posted by Freeman Fang <fr...@gmail.com>.
Hi Lukasz,

The JbiConstants.PROTOCOL_HEADERS store the protocol level headers (like 
jms headers, http headers).
So your soap header won't be saved here. The soap header in your message 
will be handled by the cxf bc in two cases
1) if the soap header is part of the parameters, it would be extracted 
according to the service model (build from the wsdl)
2) if the soap header is used for ws-* (like ws-security, ws-addressing, 
etc), it would be extract and processed by the related interceptors your 
specified for the cxf bc endpoint.

Regards
Freeman
Lukasz L. wrote:
> the SOAP header was exactly as I posted below ... that's why I wondered why
> it's not fully logged (that was logged using Trace component) or if it's not
> fully copied to property
>
> Lukasz
>
>
> Ashwin Karpe wrote:
>   
>> Oops, yes indeed, It is JbiConstants.PROTOCOL_HEADERS...
>>
>> The contents would depend on your SOAP Headers. If the Header section is
>> empty, I could expect to see the information you have specified...
>>
>>
>> Lukasz L. wrote:
>>     
>>> I also did a test and a message with the following header:
>>> 	<soapenv:Header>
>>> 		<eb:MessageHeader soapenv:mustUnderstand="0">
>>> 			<eb:ConversationId>12345</eb:ConversationId>
>>> 		</eb:MessageHeader>
>>> 	</soapenv:Header>
>>>
>>> and what is looged is:
>>> properties: 
>>> {javax.jbi.messaging.protocol.headers={{http://eb}MessageHeader=[eb:MessageHeader:
>>> null]}}}
>>>
>>> is that what should we expect?
>>>
>>>       
>>     
>
>   


Re: SOAP headers and CXF Provider

Posted by "Lukasz L." <Lu...@sabre.com>.
the SOAP header was exactly as I posted below ... that's why I wondered why
it's not fully logged (that was logged using Trace component) or if it's not
fully copied to property

Lukasz


Ashwin Karpe wrote:
> 
> Oops, yes indeed, It is JbiConstants.PROTOCOL_HEADERS...
> 
> The contents would depend on your SOAP Headers. If the Header section is
> empty, I could expect to see the information you have specified...
> 
> 
> Lukasz L. wrote:
>> 
>> 
>> I also did a test and a message with the following header:
>> 	<soapenv:Header>
>> 		<eb:MessageHeader soapenv:mustUnderstand="0">
>> 			<eb:ConversationId>12345</eb:ConversationId>
>> 		</eb:MessageHeader>
>> 	</soapenv:Header>
>> 
>> and what is looged is:
>> properties: 
>> {javax.jbi.messaging.protocol.headers={{http://eb}MessageHeader=[eb:MessageHeader:
>> null]}}}
>> 
>> is that what should we expect?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20924518.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SOAP headers and CXF Provider

Posted by Ashwin Karpe <as...@progress.com>.
Oops, yes indeed, It is JbiConstants.PROTOCOL_HEADERS...

The contents would depend on your SOAP Headers. If the Header section is
empty, I could expect to see the information you have specified...

Hope this helps.

Cheers,

Ashwin...



Lukasz L. wrote:
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi Lukasz,
>> 
>> The rules of the game are same for the Provider and Consumer. Only the
>> directionality and role changes....
>> The Provider will therefore look for a Raw XML message if SOAP="false"
>> and not go looking for a SOAP Header in JBI properties.
>> 
>> As for your second question, the JBI property used to store the SOAP
>> Header constent if SOAP="true" is JbiConstants.SOAP_HEADERS
>> 
>> 
> 
> Thank you for the response.
> Didn't you mean JbiConstants.PROTOCOL_HEADERS ? 
> I can't find SOAP_HEADERS and the name of the property I see in the log
> match PROTOCOL_HEADERS
> 
> I also did a test and a message with the following header:
> 	<soapenv:Header>
> 		<eb:MessageHeader soapenv:mustUnderstand="0">
> 			<eb:ConversationId>12345</eb:ConversationId>
> 		</eb:MessageHeader>
> 	</soapenv:Header>
> 
> and what is looged is:
> properties: 
> {javax.jbi.messaging.protocol.headers={{http://eb}MessageHeader=[eb:MessageHeader:
> null]}}}
> 
> is that what should we expect?
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20919797.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SOAP headers and CXF Provider

Posted by "Lukasz L." <Lu...@sabre.com>.

Ashwin Karpe wrote:
> 
> Hi Lukasz,
> 
> The rules of the game are same for the Provider and Consumer. Only the
> directionality and role changes....
> The Provider will therefore look for a Raw XML message if SOAP="false" and
> not go looking for a SOAP Header in JBI properties.
> 
> As for your second question, the JBI property used to store the SOAP
> Header constent if SOAP="true" is JbiConstants.SOAP_HEADERS
> 
> 

Thank you for the response.
Didn't you mean JbiConstants.PROTOCOL_HEADERS ? 
I can't find SOAP_HEADERS and the name of the property I see in the log
match PROTOCOL_HEADERS

I also did a test and a message with the following header:
	<soapenv:Header>
		<eb:MessageHeader soapenv:mustUnderstand="0">
			<eb:ConversationId>12345</eb:ConversationId>
		</eb:MessageHeader>
	</soapenv:Header>

and what is looged is:
properties: 
{javax.jbi.messaging.protocol.headers={{http://eb}MessageHeader=[eb:MessageHeader:
null]}}}

is that what should we expect?
-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20918123.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SOAP headers and CXF Provider

Posted by Ashwin Karpe <as...@progress.com>.
Hi Lukasz,

The rules of the game are same for the Provider and Consumer. Only the
directionality and role changes....
The Provider will therefore look for a Raw XML message if SOAP="false" and
not go looking for a SOAP Header in JBI properties.

As for your second question, the JBI property used to store the SOAP Header
constent if SOAP="true" is JbiConstants.SOAP_HEADERS

Cheers,

Ashwin...


Lukasz L. wrote:
> 
> hi Ashwin,
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi Lukasz,
>> 
>> 1. If the NormalizedMessage that is sent to CXF Provider already contains
>> full SOAP envelope with SOAP headers will it be sent "as is" along with
>> these headers to the target service?
>> 
>> Ashwin --> The SOAP Header is only preserved in the message if the flag
>> SOAP is set to "false" in the HTTP/JMS/CXF consumer.The SOAP header is
>> not lost however if SOAP is set to true. When the exchange is created the
>> SOAP header is stripped and preserved in JBI properties on the exchange.
>> The contents of the SOAP Body are what is sent in the message. The
>> message is now a JBI message and not a SOAP Envelope.
>> 
> 
> but I asked about the CXF Provider, so the question would be when the CXF
> provider has useSoapEnvelope=true will it use the entire incoming SOAP
> envelope with headers? (supposing that it got the whole SOAP enveloper in
> NM content)
> 
> also, what is the name of JBI properties that used to store the header
> content?
> 
> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20898368.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SOAP headers and CXF Provider

Posted by "Lukasz L." <Lu...@sabre.com>.
hi Ashwin,


Ashwin Karpe wrote:
> 
> Hi Lukasz,
> 
> 1. If the NormalizedMessage that is sent to CXF Provider already contains
> full SOAP envelope with SOAP headers will it be sent "as is" along with
> these headers to the target service?
> 
> Ashwin --> The SOAP Header is only preserved in the message if the flag
> SOAP is set to "false" in the HTTP/JMS/CXF consumer.The SOAP header is not
> lost however if SOAP is set to true. When the exchange is created the SOAP
> header is stripped and preserved in JBI properties on the exchange. The
> contents of the SOAP Body are what is sent in the message. The message is
> now a JBI message and not a SOAP Envelope.
> 

but I asked about the CXF Provider, so the question would be when the CXF
provider has useSoapEnvelope=true will it use the entire incoming SOAP
envelope with headers? (supposing that it got the whole SOAP enveloper in NM
content)

also, what is the name of JBI properties that used to store the header
content?



-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20897080.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SOAP headers and CXF Provider

Posted by Ashwin Karpe <as...@progress.com>.
Hi Lukasz,

1. If the NormalizedMessage that is sent to CXF Provider already contains
full SOAP envelope with SOAP headers will it be sent "as is" along with
these headers to the target service?

Ashwin --> The SOAP Header is only preserved in the message if the flag SOAP
is set to "false" in the HTTP/JMS/CXF consumer.The SOAP header is not lost
however if SOAP is set to true. When the exchange is created the SOAP header
is stripped and preserved in JBI properties on the exchange. The contents of
the SOAP Body are what is sent in the message. The message is now a JBI
message and not a SOAP Envelope.

2. What is the other way to tell CXF Provider what SOAP headers headers
should it send? Are they taken from some NormalizedMessage properties? If
yes, what's should be the name of the property?

Ashwin --> If the SOAP flag is set to "false" the message is treated as raw
and propagated as is to the next JBI service/endpoint. At this point the
payload could be thought of as any valid XML (HTML, ebXML etc)

3. What does CXF Consumer do with SOAP headers when it has the flag
useSOAPEnvelope="false" and useJbiWrapper="false" ?
Ashwin --> The flag useSOAPEnvelope="false" specifies if the endpoint
expects soap messages when useJBIWrapper is false. 

Hope this helps.

Cheers,

Ashwin...



Lukasz L. wrote:
> 
> hello,
> 
> I have a few questions regarding behavior of CXF Provider in terms of SOAP
> Headers:
> 1. If the NormalizedMessage that is sent to CXF Provider already contains
> full SOAP envelope with SOAP headers will it be sent "as is" along with
> these headers to the target service?
> 2. What is the other way to tell CXF Provider what SOAP headers headers
> should it send? Are they taken from some NormalizedMessage properties? If
> yes, what's should be the name of the property?
> 3. What does CXF Consumer do with SOAP headers when it has the flag
> useSOAPEnvelope="false" and useJbiWrapper="false" ?
> 
> regards
> Lukasz
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/SOAP-headers-and-CXF-Provider-tp20893998p20894678.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.