You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by cmoulliard <cm...@gmail.com> on 2010/02/25 14:09:48 UTC

Apache CXF - Camel wiki page : clarification requested

Hi, 

The cxf camel wiki page introduces the following CXF concepts which are not
well described / explained. Can someone provide more info in order to
improve the documentation please ?

Concepts to be clarified

- PRE-STREAM
- IN-BAND
- OUT-BAND

Coming from this part of the camel doc

CXF's LoggingOutInterceptor outputs outbound message that goes on the wire
to logging system (Java Util Logging). Since the LoggingOutInterceptor is in
PRE_STREAM phase (but PRE_STREAM phase is removed in MESSAGE mode), you have
to configure LoggingOutInterceptor to be run during the WRITE phase. The
following is an example.

   <bean id="loggingOutInterceptor"
class="org.apache.cxf.interceptor.LoggingOutInterceptor">

        <!--  it really should have been user-prestream but CXF does have
such phase! -->
        <constructor-arg value="write"/> 

   </bean>
   		
<cxf:cxfEndpoint id="serviceEndpoint"
address="http://localhost:9002/helloworld"

	serviceClass="org.apache.camel.component.cxf.HelloService">
	<cxf:outInterceptors>
	    <ref bean="loggingOutInterceptor"/>

	</cxf:outInterceptors>
	<cxf:properties>
		<entry key="dataFormat" value="MESSAGE"/>

	</cxf:properties>
</cxf:cxfEndpoint>

Description of relayHeaders option

There are in-band and out-of-band on-the-wire headers from the perspective
of a JAXWS WSDL-first developer.

The in-band headers are headers that are explicitly defined as part of the
WSDL binding contract for an endpoint such as SOAP headers.

Kind regards,

Charles

-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://old.nabble.com/Apache-CXF---Camel-wiki-page-%3A-clarification-requested-tp27714418p27714418.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Apache CXF - Camel wiki page : clarification requested

Posted by Willem Jiang <wi...@gmail.com>.
Daniel Kulp wrote:
> On Thu February 25 2010 8:09:48 am cmoulliard wrote:
>> Hi,
>>
>> The cxf camel wiki page introduces the following CXF concepts which are not
>> well described / explained. Can someone provide more info in order to
>> improve the documentation please ?
>>
>> Concepts to be clarified
>>
>> - PRE-STREAM
> 
> For some reason that I don't understand, Camel removes everything in this 
> phase.   I never really understood the complete details as to why.   
> Unfortunately, that means the Logging interceptor gets removed.

The interceptors which phase is PRE-STREM will be removed because we 
skip the java object to XML marshal interceptors for the camel-cxf 
endpoints that works in the PAYLOAD dataformat.
So the wiki shows you workaround of configure the LoggingOutInterceptor.
> 
> 
>> - IN-BAND
>> - OUT-BAND
> 
> Headers in a soap message are compared to stuff in the WSDL (and generated 
> code) in one of three ways:
> 
> 1) Header is defined as an element in the SAME wsdl message as the rest of the 
> body.   In this case, by default, a wsdl2java generates a parameter on the 
> method for it with header=true.
> 
> 2) Header is defined as an element in a DIFFERENT message in the wsdl.  By 
> default, jaxws does NOT generate a param for it.  However, we have an "-exsh 
> true" flag to wsdl2java to make it generate a param for it.  
> 
> 3) Header not defined in WSDL at all.   It's just on the soap message itself.  
> Things like ws-addressing headers, security headers, etc... would technically 
> fall into this.
> 
> I'm not really sure what camel is trying to describe and what it's donig with 
> it.   Most likely, the flag is trying to deal with #2 where the wsdl DOES 
> define the header, but the generated service may or may not have a parameter 
> for it depending on how the code was generated.
> 
> Does that help at all?
> 
> Dan

The Description of the Header part is for routing the message request 
from camel-cxf consumer to camel-cxf producer, if we set the 
relayHeaders option to be true, the headers which is not part of the 
WSDL contract will be copy to camel-cxf producer for sending.

Willem

> 
> 
> 
>> Coming from this part of the camel doc
>>
>> CXF's LoggingOutInterceptor outputs outbound message that goes on the wire
>> to logging system (Java Util Logging). Since the LoggingOutInterceptor is
>> in PRE_STREAM phase (but PRE_STREAM phase is removed in MESSAGE mode), you
>> have to configure LoggingOutInterceptor to be run during the WRITE phase.
>> The following is an example.
>>
>>    <bean id="loggingOutInterceptor"
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor">
>>
>>         <!--  it really should have been user-prestream but CXF does have
>> such phase! -->
>>         <constructor-arg value="write"/>
>>
>>    </bean>
>>
>> <cxf:cxfEndpoint id="serviceEndpoint"
>> address="http://localhost:9002/helloworld"
>>
>> 	serviceClass="org.apache.camel.component.cxf.HelloService">
>> 	<cxf:outInterceptors>
>> 	    <ref bean="loggingOutInterceptor"/>
>>
>> 	</cxf:outInterceptors>
>> 	<cxf:properties>
>> 		<entry key="dataFormat" value="MESSAGE"/>
>>
>> 	</cxf:properties>
>> </cxf:cxfEndpoint>
>>
>> Description of relayHeaders option
>>
>> There are in-band and out-of-band on-the-wire headers from the perspective
>> of a JAXWS WSDL-first developer.
>>
>> The in-band headers are headers that are explicitly defined as part of the
>> WSDL binding contract for an endpoint such as SOAP headers.
>>
>> Kind regards,
>>
>> Charles
>>
>> -----
>> Charles Moulliard
>> SOA Architect
>>
>> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> 


Re: Apache CXF - Camel wiki page : clarification requested

Posted by Willem Jiang <wi...@gmail.com>.
Daniel Kulp wrote:
> On Thu February 25 2010 8:09:48 am cmoulliard wrote:
>> Hi,
>>
>> The cxf camel wiki page introduces the following CXF concepts which are not
>> well described / explained. Can someone provide more info in order to
>> improve the documentation please ?
>>
>> Concepts to be clarified
>>
>> - PRE-STREAM
> 
> For some reason that I don't understand, Camel removes everything in this 
> phase.   I never really understood the complete details as to why.   
> Unfortunately, that means the Logging interceptor gets removed.

The interceptors which phase is PRE-STREM will be removed because we 
skip the java object to XML marshal interceptors for the camel-cxf 
endpoints that works in the PAYLOAD dataformat.
So the wiki shows you workaround of configure the LoggingOutInterceptor.
> 
> 
>> - IN-BAND
>> - OUT-BAND
> 
> Headers in a soap message are compared to stuff in the WSDL (and generated 
> code) in one of three ways:
> 
> 1) Header is defined as an element in the SAME wsdl message as the rest of the 
> body.   In this case, by default, a wsdl2java generates a parameter on the 
> method for it with header=true.
> 
> 2) Header is defined as an element in a DIFFERENT message in the wsdl.  By 
> default, jaxws does NOT generate a param for it.  However, we have an "-exsh 
> true" flag to wsdl2java to make it generate a param for it.  
> 
> 3) Header not defined in WSDL at all.   It's just on the soap message itself.  
> Things like ws-addressing headers, security headers, etc... would technically 
> fall into this.
> 
> I'm not really sure what camel is trying to describe and what it's donig with 
> it.   Most likely, the flag is trying to deal with #2 where the wsdl DOES 
> define the header, but the generated service may or may not have a parameter 
> for it depending on how the code was generated.
> 
> Does that help at all?
> 
> Dan

The Description of the Header part is for routing the message request 
from camel-cxf consumer to camel-cxf producer, if we set the 
relayHeaders option to be true, the headers which is not part of the 
WSDL contract will be copy to camel-cxf producer for sending.

Willem

> 
> 
> 
>> Coming from this part of the camel doc
>>
>> CXF's LoggingOutInterceptor outputs outbound message that goes on the wire
>> to logging system (Java Util Logging). Since the LoggingOutInterceptor is
>> in PRE_STREAM phase (but PRE_STREAM phase is removed in MESSAGE mode), you
>> have to configure LoggingOutInterceptor to be run during the WRITE phase.
>> The following is an example.
>>
>>    <bean id="loggingOutInterceptor"
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor">
>>
>>         <!--  it really should have been user-prestream but CXF does have
>> such phase! -->
>>         <constructor-arg value="write"/>
>>
>>    </bean>
>>
>> <cxf:cxfEndpoint id="serviceEndpoint"
>> address="http://localhost:9002/helloworld"
>>
>> 	serviceClass="org.apache.camel.component.cxf.HelloService">
>> 	<cxf:outInterceptors>
>> 	    <ref bean="loggingOutInterceptor"/>
>>
>> 	</cxf:outInterceptors>
>> 	<cxf:properties>
>> 		<entry key="dataFormat" value="MESSAGE"/>
>>
>> 	</cxf:properties>
>> </cxf:cxfEndpoint>
>>
>> Description of relayHeaders option
>>
>> There are in-band and out-of-band on-the-wire headers from the perspective
>> of a JAXWS WSDL-first developer.
>>
>> The in-band headers are headers that are explicitly defined as part of the
>> WSDL binding contract for an endpoint such as SOAP headers.
>>
>> Kind regards,
>>
>> Charles
>>
>> -----
>> Charles Moulliard
>> SOA Architect
>>
>> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> 


Re: Apache CXF - Camel wiki page : clarification requested

Posted by Daniel Kulp <dk...@apache.org>.
On Thu February 25 2010 8:09:48 am cmoulliard wrote:
> Hi,
> 
> The cxf camel wiki page introduces the following CXF concepts which are not
> well described / explained. Can someone provide more info in order to
> improve the documentation please ?
> 
> Concepts to be clarified
> 
> - PRE-STREAM

For some reason that I don't understand, Camel removes everything in this 
phase.   I never really understood the complete details as to why.   
Unfortunately, that means the Logging interceptor gets removed.


> - IN-BAND
> - OUT-BAND

Headers in a soap message are compared to stuff in the WSDL (and generated 
code) in one of three ways:

1) Header is defined as an element in the SAME wsdl message as the rest of the 
body.   In this case, by default, a wsdl2java generates a parameter on the 
method for it with header=true.

2) Header is defined as an element in a DIFFERENT message in the wsdl.  By 
default, jaxws does NOT generate a param for it.  However, we have an "-exsh 
true" flag to wsdl2java to make it generate a param for it.  

3) Header not defined in WSDL at all.   It's just on the soap message itself.  
Things like ws-addressing headers, security headers, etc... would technically 
fall into this.

I'm not really sure what camel is trying to describe and what it's donig with 
it.   Most likely, the flag is trying to deal with #2 where the wsdl DOES 
define the header, but the generated service may or may not have a parameter 
for it depending on how the code was generated.

Does that help at all?

Dan



> 
> Coming from this part of the camel doc
> 
> CXF's LoggingOutInterceptor outputs outbound message that goes on the wire
> to logging system (Java Util Logging). Since the LoggingOutInterceptor is
> in PRE_STREAM phase (but PRE_STREAM phase is removed in MESSAGE mode), you
> have to configure LoggingOutInterceptor to be run during the WRITE phase.
> The following is an example.
> 
>    <bean id="loggingOutInterceptor"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor">
> 
>         <!--  it really should have been user-prestream but CXF does have
> such phase! -->
>         <constructor-arg value="write"/>
> 
>    </bean>
> 
> <cxf:cxfEndpoint id="serviceEndpoint"
> address="http://localhost:9002/helloworld"
> 
> 	serviceClass="org.apache.camel.component.cxf.HelloService">
> 	<cxf:outInterceptors>
> 	    <ref bean="loggingOutInterceptor"/>
> 
> 	</cxf:outInterceptors>
> 	<cxf:properties>
> 		<entry key="dataFormat" value="MESSAGE"/>
> 
> 	</cxf:properties>
> </cxf:cxfEndpoint>
> 
> Description of relayHeaders option
> 
> There are in-band and out-of-band on-the-wire headers from the perspective
> of a JAXWS WSDL-first developer.
> 
> The in-band headers are headers that are explicitly defined as part of the
> WSDL binding contract for an endpoint such as SOAP headers.
> 
> Kind regards,
> 
> Charles
> 
> -----
> Charles Moulliard
> SOA Architect
> 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog