You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Radomir Kadlec <ra...@aura.cz> on 2012/04/17 09:28:16 UTC

Setting and transfering message parameters

Hello,
how can I set and get a message parameter in my own interceptor?
I have own testInterceptor in *cxfbc:consumer* and set a new message
parameter:
    public void handleMessage(Message message) {
        message.put("KEY", "value");

The message is than routed to *cxfbc:provider*.
But the *message doesnt contain this parameter* in cxfbc:provider.
Why?
How can I achieve message parameter is transfered from consumer to provider?

I use osgi deployment in apache-servicemix-4.4.1-fuse-02-05

Thanks,
Radomir

*The endpoints configuration:*
    <cxfbc:consumer    
        service="isl-a:IslAWebService"
        endpoint="IslAWebServiceSoap"
        locationURI="${ws-isl-a.esbUrl}"
        wsdl="classpath:wsdl/isl_a.wsdl"
        targetService="isl-a:IslAWebService"
        targetEndpoint="IslAWebServiceSoapProvider"
        schemaValidationEnabled="true"
        delegateToJaas="true"
        properties="#properties"
        providedBus="#cxf"
        >
        <cxfbc:inInterceptors>
            <ref bean="testInterceptor" />
            <ref bean="UserName_RequestIn" />
            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
        </cxfbc:inInterceptors>
    </cxfbc:consumer>

    <cxfbc:provider
        service="isl-a:IslAWebService"
        endpoint="IslAWebServiceSoapProvider"
        wsdl="classpath:wsdl/isl_a.wsdl"
        locationURI="http://localhost:8194/islAFile"
        >        
        <cxfbc:inInterceptors>
            <ref bean="testInterceptor" />
            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
        </cxfbc:inInterceptors>
        <cxfbc:outInterceptors>
            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"
/>
        </cxfbc:outInterceptors>
    </cxfbc:provider>


--
View this message in context: http://servicemix.396122.n5.nabble.com/Setting-and-transfering-message-parameters-tp5645861p5645861.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Setting and transfering message parameters

Posted by Radomir Kadlec <ra...@aura.cz>.
Thanks Freeman,
saving parameters in JBI normalized message works.

Radomir

--
View this message in context: http://servicemix.396122.n5.nabble.com/Setting-and-transfering-message-parameters-tp5645861p5684920.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Setting and transfering message parameters

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

You need save properties in JBI normalized message but not the CXF  
message, as JBI normalized message is the one pass though JBI broker.  
Take a look at a similar discussion[1]. It's the scenario between cxf  
bc consumer and cxf bc se, but cxfbc consumer====> cxfbc provider  
should be the same case.

[1]http://servicemix.396122.n5.nabble.com/Can-cxf-bc-and-cxf-se-interceptors-share-context-td417409.html

Freeman
On 2012-4-17, at 下午3:28, Radomir Kadlec wrote:

> Hello,
> how can I set and get a message parameter in my own interceptor?
> I have own testInterceptor in *cxfbc:consumer* and set a new message
> parameter:
>    public void handleMessage(Message message) {
>        message.put("KEY", "value");
>
> The message is than routed to *cxfbc:provider*.
> But the *message doesnt contain this parameter* in cxfbc:provider.
> Why?
> How can I achieve message parameter is transfered from consumer to  
> provider?
>
> I use osgi deployment in apache-servicemix-4.4.1-fuse-02-05
>
> Thanks,
> Radomir
>
> *The endpoints configuration:*
>    <cxfbc:consumer
>        service="isl-a:IslAWebService"
>        endpoint="IslAWebServiceSoap"
>        locationURI="${ws-isl-a.esbUrl}"
>        wsdl="classpath:wsdl/isl_a.wsdl"
>        targetService="isl-a:IslAWebService"
>        targetEndpoint="IslAWebServiceSoapProvider"
>        schemaValidationEnabled="true"
>        delegateToJaas="true"
>        properties="#properties"
>        providedBus="#cxf"
>>
>        <cxfbc:inInterceptors>
>            <ref bean="testInterceptor" />
>            <ref bean="UserName_RequestIn" />
>            <bean  
> class="org.apache.cxf.interceptor.LoggingInInterceptor" />
>        </cxfbc:inInterceptors>
>    </cxfbc:consumer>
>
>    <cxfbc:provider
>        service="isl-a:IslAWebService"
>        endpoint="IslAWebServiceSoapProvider"
>        wsdl="classpath:wsdl/isl_a.wsdl"
>        locationURI="http://localhost:8194/islAFile"
>>
>        <cxfbc:inInterceptors>
>            <ref bean="testInterceptor" />
>            <bean  
> class="org.apache.cxf.interceptor.LoggingInInterceptor" />
>        </cxfbc:inInterceptors>
>        <cxfbc:outInterceptors>
>            <bean  
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"
> />
>        </cxfbc:outInterceptors>
>    </cxfbc:provider>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Setting-and-transfering-message-parameters-tp5645861p5645861.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042