You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bharath Ganesh <bh...@gmail.com> on 2007/09/25 15:11:47 UTC

WS-RM Usage

Hi

I have been trying to get WS-RM to work in CXF. These are the steps I
followed.

WSDL: Reference to a WS-policy, containing a RMAssertion.

<wsp:Policy wsu:Id="RM">
    <wsam:Addressing>
        <wsp:Policy/>
    </wsam:Addressing>
    <wsrmp:RMAssertion>
       <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
    </wsrmp:RMAssertion>
</wsp:Policy>

But this was not enough for the client side RM configuration. The RM
Interceptors were not added even thought the service client (Generated
JAX-WS Service class) pointed to this wsdl.

So I chose to programatically get hold of the bus, enable WS-Policy, create
the RMFeature, set the RM Store and add the RMInterceptors explicitly.
Is that really needed? Shouldn't the runtime do this if wsdl contains a
WS-Policy reference, which has a RM assertion?

In added RMOutInterceptor, RMInInterceptor, RMSoapInterceptor (to in and
out), RetransmissionInterceptor (to in and out) to the client side
org.apache.cxf.endpoint.Endpoint.

After configuring all this when the message goes outward from the client I
get this exception:

Caused by: java.lang.NullPointerException
    at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledged
(RetransmissionQueueImpl.java:202)
    at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
RetransmissionQueueImpl.java:92)
    at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
RetransmissionCallback.java:56)
    at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
:113)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
:66)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
    at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage
(MessageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:207)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
:135)

This means the RMProperties is not set in the message.
What could go wrong?

RE: WS-RM Usage

Posted by "Glynn, Eoghan" <eo...@iona.com>.

OK in CXF 2.0.2, there's no need for the <UsingAddressing> element, so
you can scratch that.

I've put together a quick'n'dirty variant on the ws_rm sample which
illustrates usage of the policy framework to enable WS-RM & WS-A, and it
works fine against 2.0.2 CXF. 

I'll tar this up and mail it to you directly, so you can see exactly
what's required in the WSDL and config. Just drop this under the samples
dir of your CXF binary install.

The problem may be in your usage of the <wsp:PolicyReference>. A direct
usage of <wsp:Policy> in the <wsdl:port> works fine for me, as you can
see in the rm_policy demo I'll mail you.

Cheers,
Eoghan

> -----Original Message-----
> From: Bharath Ganesh [mailto:bharathganesh@gmail.com] 
> Sent: 26 September 2007 13:00
> To: cxf-user@incubator.apache.org
> Cc: deepak@pramati.com; Mayank@pramati.com
> Subject: Re: WS-RM Usage
> 
> Hi Glynn
> 
> 
> >1. In a previous mail on this thread you talked about adding the 
> >RMInterceptors explicitly in code - I presume you're no longer doing 
> >this and are now just relying on the RMAssertion & 
> Addressing policies 
> >attached to the WSDL and the PolicyEngine config bean?
> 
> Yes Glenn, now I do not add the interceptors explicitly. Just 
> that I explicitly enable the RMFeature at the server side 
> programmatically as
> below:
> 
> RMTxStore txStore = new RMTxStore();
> txStore.setConnection(connection);
> RMFeature feature = new RMFeature();
> feature.setStore(txStore);
> ep.getFeatures().add(feature);
> 
> 
> This is done to set the connection to be used for the store.
> 
> 
> >2. What version of CXF are you using? Up to quite recently, the 
> ><wsaw:UsingAddressing> extension element was also required 
> in the WSDL 
> >in order to enable WS-A. Try adding the following child 
> element to your
> ><wsdl:port>:
> >    <wswa:UsingAddressing
> > xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
> 
> I am using the CXF version which was put on stage by DanK for 
> 2.0.2 release (Take 2)
> 
> I also tried changing the wsdl to have the 
> <wswa:UsingAddressing> extension.
> The snapshot of the wsdl is below:
> 
> <wsdl:service name="CartSLSBBeanService">
>         <wsdl:port binding="ns1:CartSLSBBeanServiceSoapBinding"
> name="CartSLSBBeanPort">
>             <wswa:UsingAddressing xmlns:wswa="
> http://www.w3.org/2005/02/addressing/wsdl"/>
>             <soap:address location="http://localhost:8181/cart/cart"/>
>             <wsp:PolicyReference xmlns:wsp="
> http://www.w3.org/2006/07/ws-policy" URI="#RM"/>
>         </wsdl:port>
>     </wsdl:service>
>     <wsp:Policy xmlns:wsp="http://www.w3.org/2006/07/ws-policy"
>                 xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecu
> rity-utility-1.0.xsd
> "
>                 wsu:Id="RM">
>         <wsam:Addressing xmlns:wsam="
> http://www.w3.org/2007/02/addressing/metadata">
>             <wsp:Policy/>
>         </wsam:Addressing>
>         <wsrmp:RMAssertion xmlns:wsrmp="
> http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
>             <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
>         </wsrmp:RMAssertion>
>     </wsp:Policy>
> 
> I hope this is ok.
> 
> After using this wsdl at the client and server still I get the below
> exception:
> 
> Main message  ID: ;Failed to retrieve message addressing 
> properties from context - not ensuring reliable delivery.
>   Messages Trace:
>       retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>       WS-Addressing - failed to retrieve Message Addressing 
> Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>       retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>       WS-Addressing - failed to retrieve Message Addressing 
> Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>       retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>       WS-Addressing - failed to retrieve Message Addressing 
> Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>       Failed to retrieve message addressing properties from 
> context - not ensuring reliable 
> delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)
> 
> Hope this is the correct way of doing this. Or am I missing something?
> 
> Any help would be appreciated.
> 
> -Bharath
> 
> 
> On 9/26/07, Glynn, Eoghan <eo...@iona.com> wrote:
> >
> >
> >
> > The problem here seems to be that the WS-RM layer cannot 
> retrieve the 
> > addressing properties that WS-A layer should have stored in 
> the context.
> >
> > A couple of questions:
> >
> > 1. In a previous mail on this thread you talked about adding the 
> > RMInterceptors explicitly in code - I presume you're no 
> longer doing 
> > this and are now just relying on the RMAssertion & 
> Addressing policies 
> > attached to the WSDL and the PolicyEngine config bean?
> >
> > 2. What version of CXF are you using? Up to quite recently, the 
> > <wsaw:UsingAddressing> extension element was also required 
> in the WSDL 
> > in order to enable WS-A. Try adding the following child element to 
> > your
> > <wsdl:port>:
> >
> >     <wswa:UsingAddressing
> > xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
> >
> > Cheers,
> > Eoghan
> >
> >
> > > -----Original Message-----
> > > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> > > Sent: 26 September 2007 05:43
> > > To: cxf-user@incubator.apache.org
> > > Subject: Re: WS-RM Usage
> > >
> > > My wsdl now contains the RM-Assertion and I have enabled 
> the policy 
> > > engine (by getting hold of PolicyEngine from the bus).
> > >
> > > But when I invoke the webservice, I get the following message:
> > >
> > > Failed to retrieve message addressing properties from context
> > > - not ensuring reliable delivery.
> > >   Messages Trace:
> > >       retrieving MAPs from context property {0};(
> > > org.apache.cxf.ws.addressing.ContextUtils)
> > >       WS-Addressing - failed to retrieve Message Addressing 
> > > Properties from
> > > context;(org.apache.cxf.ws.addressing.ContextUtils)
> > >       retrieving MAPs from context property {0};(
> > > org.apache.cxf.ws.addressing.ContextUtils)
> > >       WS-Addressing - failed to retrieve Message Addressing 
> > > Properties from
> > > context;(org.apache.cxf.ws.addressing.ContextUtils)
> > >       retrieving MAPs from context property {0};(
> > > org.apache.cxf.ws.addressing.ContextUtils)
> > >       WS-Addressing - failed to retrieve Message Addressing 
> > > Properties from
> > > context;(org.apache.cxf.ws.addressing.ContextUtils)
> > >       Failed to retrieve message addressing properties 
> from context 
> > > - not ensuring reliable
> > > delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)
> > >
> > >
> > > What could have gone wrong?
> > >
> > > -Bharath
> > >
> > >
> > >
> > >
> > > On 9/25/07, Glynn, Eoghan <eo...@iona.com> wrote:
> > > >
> > > >
> > > >
> > > > The presence of RMAssertion in the WSDL is enough for 
> WS-RM to be 
> > > > engaged in the client-runtime *if* the policy engine is
> > > turned on the
> > > > client config, via something like the following:
> > > >
> > > >     <bean id="org.apache.cxf.ws.policy.PolicyEngine"
> > > > 
> class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
> > > >         <property name="bus" ref="cxf"/>
> > > >         <property name="enabled" value="true"/>
> > > >     </bean>
> > > >
> > > > See the ws_policy demo for an example of this usage and 
> also the 
> > > > docco[1] for more details.
> > > >
> > > > This automatic injection of capability into the runtime
> > > triggered by
> > > > the presence of policy assertions is one of the main goals
> > > of the CXF
> > > > WS-Policy framework[2].
> > > >
> > > > Cheers,
> > > > Eoghan
> > > >
> > > > [1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
> > > > [2]
> > > http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> > > > > Sent: 25 September 2007 14:12
> > > > > To: cxf-user@incubator.apache.org
> > > > > Subject: WS-RM Usage
> > > > >
> > > > > Hi
> > > > >
> > > > > I have been trying to get WS-RM to work in CXF. These are
> > > the steps
> > > > > I followed.
> > > > >
> > > > > WSDL: Reference to a WS-policy, containing a RMAssertion.
> > > > >
> > > > > <wsp:Policy wsu:Id="RM">
> > > > >     <wsam:Addressing>
> > > > >         <wsp:Policy/>
> > > > >     </wsam:Addressing>
> > > > >     <wsrmp:RMAssertion>
> > > > >        <wsrmp:BaseRetransmissionInterval 
> Milliseconds="10000"/>
> > > > >     </wsrmp:RMAssertion>
> > > > > </wsp:Policy>
> > > > >
> > > > > But this was not enough for the client side RM configuration.
> > > > > The RM Interceptors were not added even thought the
> > > service client
> > > > > (Generated JAX-WS Service class) pointed to this wsdl.
> > > > >
> > > > > So I chose to programatically get hold of the bus, enable
> > > WS-Policy,
> > > > > create the RMFeature, set the RM Store and add the 
> > > > > RMInterceptors explicitly.
> > > > > Is that really needed? Shouldn't the runtime do this if wsdl 
> > > > > contains a WS-Policy reference, which has a RM assertion?
> > > > >
> > > > > In added RMOutInterceptor, RMInInterceptor,
> > > RMSoapInterceptor (to in
> > > > > and out), RetransmissionInterceptor (to in and out) to the 
> > > > > client side org.apache.cxf.endpoint.Endpoint.
> > > > >
> > > > > After configuring all this when the message goes outward from 
> > > > > the client I get this exception:
> > > > >
> > > > > Caused by: java.lang.NullPointerException
> > > > >     at
> > > > >
> > > 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledge
> > > > > d
> > > > > (RetransmissionQueueImpl.java:202)
> > > > >     at
> > > > >
> > > 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> > > > > RetransmissionQueueImpl.java:92)
> > > > >     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> > > > > RetransmissionCallback.java:56)
> > > > >     at
> > > > > 
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.ja
> > > > > va
> > > > > :113)
> > > > >     at
> > > > >
> > > 
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> > > > > :66)
> > > > >     at
> > > > >
> > > 
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576
> > > )
> > > > >     at
> > > > > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> > > > > derEndingInterceptor.handleMessage
> > > > > (MessageSenderInterceptor.java:62)
> > > > >     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > > > > PhaseInterceptorChain.java:207)
> > > > >     at
> > > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> > > > >     at
> > > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
> > > > >     at
> > > > >
> > > 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> > > > >     at
> > > > > 
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.ja
> > > > > va
> > > > > :135)
> > > > >
> > > > > This means the RMProperties is not set in the message.
> > > > > What could go wrong?
> > > > >
> > > >
> > > > ----------------------------
> > > > IONA Technologies PLC (registered in Ireland) Registered Number:
> > > > 171387 Registered Address: The IONA Building, Shelbourne
> > > Road, Dublin
> > > > 4, Ireland
> > > >
> > >
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland) Registered Number: 
> > 171387 Registered Address: The IONA Building, Shelbourne 
> Road, Dublin 
> > 4, Ireland
> >
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: WS-RM Usage

Posted by Bharath Ganesh <bh...@gmail.com>.
Hi Glynn


>1. In a previous mail on this thread you talked about adding the
>RMInterceptors explicitly in code - I presume you're no longer doing
>this and are now just relying on the RMAssertion & Addressing policies
>attached to the WSDL and the PolicyEngine config bean?

Yes Glenn, now I do not add the interceptors explicitly. Just that I
explicitly enable the RMFeature at the server side programmatically as
below:

RMTxStore txStore = new RMTxStore();
txStore.setConnection(connection);
RMFeature feature = new RMFeature();
feature.setStore(txStore);
ep.getFeatures().add(feature);


This is done to set the connection to be used for the store.


>2. What version of CXF are you using? Up to quite recently, the
><wsaw:UsingAddressing> extension element was also required in the WSDL
>in order to enable WS-A. Try adding the following child element to your
><wsdl:port>:
>    <wswa:UsingAddressing
> xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>

I am using the CXF version which was put on stage by DanK for 2.0.2 release
(Take 2)

I also tried changing the wsdl to have the <wswa:UsingAddressing> extension.
The snapshot of the wsdl is below:

<wsdl:service name="CartSLSBBeanService">
        <wsdl:port binding="ns1:CartSLSBBeanServiceSoapBinding"
name="CartSLSBBeanPort">
            <wswa:UsingAddressing xmlns:wswa="
http://www.w3.org/2005/02/addressing/wsdl"/>
            <soap:address location="http://localhost:8181/cart/cart"/>
            <wsp:PolicyReference xmlns:wsp="
http://www.w3.org/2006/07/ws-policy" URI="#RM"/>
        </wsdl:port>
    </wsdl:service>
    <wsp:Policy xmlns:wsp="http://www.w3.org/2006/07/ws-policy"
                xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
"
                wsu:Id="RM">
        <wsam:Addressing xmlns:wsam="
http://www.w3.org/2007/02/addressing/metadata">
            <wsp:Policy/>
        </wsam:Addressing>
        <wsrmp:RMAssertion xmlns:wsrmp="
http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
            <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
        </wsrmp:RMAssertion>
    </wsp:Policy>

I hope this is ok.

After using this wsdl at the client and server still I get the below
exception:

Main message  ID: ;Failed to retrieve message addressing properties from
context - not ensuring reliable delivery.
  Messages Trace:
      retrieving MAPs from context property {0};(
org.apache.cxf.ws.addressing.ContextUtils)
      WS-Addressing - failed to retrieve Message Addressing Properties from
context;(org.apache.cxf.ws.addressing.ContextUtils)
      retrieving MAPs from context property {0};(
org.apache.cxf.ws.addressing.ContextUtils)
      WS-Addressing - failed to retrieve Message Addressing Properties from
context;(org.apache.cxf.ws.addressing.ContextUtils)
      retrieving MAPs from context property {0};(
org.apache.cxf.ws.addressing.ContextUtils)
      WS-Addressing - failed to retrieve Message Addressing Properties from
context;(org.apache.cxf.ws.addressing.ContextUtils)
      Failed to retrieve message addressing properties from context - not
ensuring reliable delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)

Hope this is the correct way of doing this. Or am I missing something?

Any help would be appreciated.

-Bharath


On 9/26/07, Glynn, Eoghan <eo...@iona.com> wrote:
>
>
>
> The problem here seems to be that the WS-RM layer cannot retrieve the
> addressing properties that WS-A layer should have stored in the context.
>
> A couple of questions:
>
> 1. In a previous mail on this thread you talked about adding the
> RMInterceptors explicitly in code - I presume you're no longer doing
> this and are now just relying on the RMAssertion & Addressing policies
> attached to the WSDL and the PolicyEngine config bean?
>
> 2. What version of CXF are you using? Up to quite recently, the
> <wsaw:UsingAddressing> extension element was also required in the WSDL
> in order to enable WS-A. Try adding the following child element to your
> <wsdl:port>:
>
>     <wswa:UsingAddressing
> xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
>
> Cheers,
> Eoghan
>
>
> > -----Original Message-----
> > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> > Sent: 26 September 2007 05:43
> > To: cxf-user@incubator.apache.org
> > Subject: Re: WS-RM Usage
> >
> > My wsdl now contains the RM-Assertion and I have enabled the
> > policy engine (by getting hold of PolicyEngine from the bus).
> >
> > But when I invoke the webservice, I get the following message:
> >
> > Failed to retrieve message addressing properties from context
> > - not ensuring reliable delivery.
> >   Messages Trace:
> >       retrieving MAPs from context property {0};(
> > org.apache.cxf.ws.addressing.ContextUtils)
> >       WS-Addressing - failed to retrieve Message Addressing
> > Properties from
> > context;(org.apache.cxf.ws.addressing.ContextUtils)
> >       retrieving MAPs from context property {0};(
> > org.apache.cxf.ws.addressing.ContextUtils)
> >       WS-Addressing - failed to retrieve Message Addressing
> > Properties from
> > context;(org.apache.cxf.ws.addressing.ContextUtils)
> >       retrieving MAPs from context property {0};(
> > org.apache.cxf.ws.addressing.ContextUtils)
> >       WS-Addressing - failed to retrieve Message Addressing
> > Properties from
> > context;(org.apache.cxf.ws.addressing.ContextUtils)
> >       Failed to retrieve message addressing properties from
> > context - not ensuring reliable
> > delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)
> >
> >
> > What could have gone wrong?
> >
> > -Bharath
> >
> >
> >
> >
> > On 9/25/07, Glynn, Eoghan <eo...@iona.com> wrote:
> > >
> > >
> > >
> > > The presence of RMAssertion in the WSDL is enough for WS-RM to be
> > > engaged in the client-runtime *if* the policy engine is
> > turned on the
> > > client config, via something like the following:
> > >
> > >     <bean id="org.apache.cxf.ws.policy.PolicyEngine"
> > > class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
> > >         <property name="bus" ref="cxf"/>
> > >         <property name="enabled" value="true"/>
> > >     </bean>
> > >
> > > See the ws_policy demo for an example of this usage and also the
> > > docco[1] for more details.
> > >
> > > This automatic injection of capability into the runtime
> > triggered by
> > > the presence of policy assertions is one of the main goals
> > of the CXF
> > > WS-Policy framework[2].
> > >
> > > Cheers,
> > > Eoghan
> > >
> > > [1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
> > > [2]
> > http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> > > > Sent: 25 September 2007 14:12
> > > > To: cxf-user@incubator.apache.org
> > > > Subject: WS-RM Usage
> > > >
> > > > Hi
> > > >
> > > > I have been trying to get WS-RM to work in CXF. These are
> > the steps
> > > > I followed.
> > > >
> > > > WSDL: Reference to a WS-policy, containing a RMAssertion.
> > > >
> > > > <wsp:Policy wsu:Id="RM">
> > > >     <wsam:Addressing>
> > > >         <wsp:Policy/>
> > > >     </wsam:Addressing>
> > > >     <wsrmp:RMAssertion>
> > > >        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
> > > >     </wsrmp:RMAssertion>
> > > > </wsp:Policy>
> > > >
> > > > But this was not enough for the client side RM configuration.
> > > > The RM Interceptors were not added even thought the
> > service client
> > > > (Generated JAX-WS Service class) pointed to this wsdl.
> > > >
> > > > So I chose to programatically get hold of the bus, enable
> > WS-Policy,
> > > > create the RMFeature, set the RM Store and add the RMInterceptors
> > > > explicitly.
> > > > Is that really needed? Shouldn't the runtime do this if wsdl
> > > > contains a WS-Policy reference, which has a RM assertion?
> > > >
> > > > In added RMOutInterceptor, RMInInterceptor,
> > RMSoapInterceptor (to in
> > > > and out), RetransmissionInterceptor (to in and out) to the client
> > > > side org.apache.cxf.endpoint.Endpoint.
> > > >
> > > > After configuring all this when the message goes outward from the
> > > > client I get this exception:
> > > >
> > > > Caused by: java.lang.NullPointerException
> > > >     at
> > > >
> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledge
> > > > d
> > > > (RetransmissionQueueImpl.java:202)
> > > >     at
> > > >
> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> > > > RetransmissionQueueImpl.java:92)
> > > >     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> > > > RetransmissionCallback.java:56)
> > > >     at
> > > > org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
> > > > :113)
> > > >     at
> > > >
> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> > > > :66)
> > > >     at
> > > >
> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
> > > >     at
> > > > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> > > > derEndingInterceptor.handleMessage
> > > > (MessageSenderInterceptor.java:62)
> > > >     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > > > PhaseInterceptorChain.java:207)
> > > >     at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> > > >     at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
> > > >     at
> > > >
> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> > > >     at
> > > > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> > > > :135)
> > > >
> > > > This means the RMProperties is not set in the message.
> > > > What could go wrong?
> > > >
> > >
> > > ----------------------------
> > > IONA Technologies PLC (registered in Ireland) Registered Number:
> > > 171387 Registered Address: The IONA Building, Shelbourne
> > Road, Dublin
> > > 4, Ireland
> > >
> >
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

Re: WS-RM Usage

Posted by Bharath Ganesh <bh...@gmail.com>.
No The whole thing runs in an app server and the bus is initialized and the
policy engine is enabled as part of server startup.

-Bharath


On 9/26/07, Sergey Beryozkin <se...@iona.com> wrote:
>
> Can it be that you enabled the policy engine too late ?
>
> Cheers, Sergey
> ----- Original Message -----
> From: "Bharath Ganesh" <bh...@gmail.com>
> To: <cx...@incubator.apache.org>
> Sent: Wednesday, September 26, 2007 5:43 AM
> Subject: Re: WS-RM Usage
>
>
> > My wsdl now contains the RM-Assertion and I have enabled the policy
> engine
> > (by getting hold of PolicyEngine from the bus).
> >
> > But when I invoke the webservice, I get the following message:
> >
> > Failed to retrieve message addressing properties from context - not
> ensuring
> > reliable delivery.
> >  Messages Trace:
> >      retrieving MAPs from context property {0};(
> > org.apache.cxf.ws.addressing.ContextUtils)
> >      WS-Addressing - failed to retrieve Message Addressing Properties
> from
> > context;(org.apache.cxf.ws.addressing.ContextUtils)
> >      retrieving MAPs from context property {0};(
> > org.apache.cxf.ws.addressing.ContextUtils)
> >      WS-Addressing - failed to retrieve Message Addressing Properties
> from
> > context;(org.apache.cxf.ws.addressing.ContextUtils)
> >      retrieving MAPs from context property {0};(
> > org.apache.cxf.ws.addressing.ContextUtils)
> >      WS-Addressing - failed to retrieve Message Addressing Properties
> from
> > context;(org.apache.cxf.ws.addressing.ContextUtils)
> >      Failed to retrieve message addressing properties from context - not
> > ensuring reliable delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)
> >
> >
> > What could have gone wrong?
> >
> > -Bharath
> >
> >
> >
> >
> > On 9/25/07, Glynn, Eoghan <eo...@iona.com> wrote:
> >>
> >>
> >>
> >> The presence of RMAssertion in the WSDL is enough for WS-RM to be
> >> engaged in the client-runtime *if* the policy engine is turned on the
> >> client config, via something like the following:
> >>
> >>     <bean id="org.apache.cxf.ws.policy.PolicyEngine"
> >> class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
> >>         <property name="bus" ref="cxf"/>
> >>         <property name="enabled" value="true"/>
> >>     </bean>
> >>
> >> See the ws_policy demo for an example of this usage and also the
> >> docco[1] for more details.
> >>
> >> This automatic injection of capability into the runtime triggered by
> the
> >> presence of policy assertions is one of the main goals of the CXF
> >> WS-Policy framework[2].
> >>
> >> Cheers,
> >> Eoghan
> >>
> >> [1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
> >> [2] http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html
> >>
> >>
> >> > -----Original Message-----
> >> > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> >> > Sent: 25 September 2007 14:12
> >> > To: cxf-user@incubator.apache.org
> >> > Subject: WS-RM Usage
> >> >
> >> > Hi
> >> >
> >> > I have been trying to get WS-RM to work in CXF. These are the
> >> > steps I followed.
> >> >
> >> > WSDL: Reference to a WS-policy, containing a RMAssertion.
> >> >
> >> > <wsp:Policy wsu:Id="RM">
> >> >     <wsam:Addressing>
> >> >         <wsp:Policy/>
> >> >     </wsam:Addressing>
> >> >     <wsrmp:RMAssertion>
> >> >        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
> >> >     </wsrmp:RMAssertion>
> >> > </wsp:Policy>
> >> >
> >> > But this was not enough for the client side RM configuration.
> >> > The RM Interceptors were not added even thought the service
> >> > client (Generated JAX-WS Service class) pointed to this wsdl.
> >> >
> >> > So I chose to programatically get hold of the bus, enable
> >> > WS-Policy, create the RMFeature, set the RM Store and add the
> >> > RMInterceptors explicitly.
> >> > Is that really needed? Shouldn't the runtime do this if wsdl
> >> > contains a WS-Policy reference, which has a RM assertion?
> >> >
> >> > In added RMOutInterceptor, RMInInterceptor, RMSoapInterceptor
> >> > (to in and out), RetransmissionInterceptor (to in and out) to
> >> > the client side org.apache.cxf.endpoint.Endpoint.
> >> >
> >> > After configuring all this when the message goes outward from
> >> > the client I get this exception:
> >> >
> >> > Caused by: java.lang.NullPointerException
> >> >     at
> >> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledged
> >> > (RetransmissionQueueImpl.java:202)
> >> >     at
> >> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> >> > RetransmissionQueueImpl.java:92)
> >> >     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> >> > RetransmissionCallback.java:56)
> >> >     at
> >> > org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
> >> > :113)
> >> >     at
> >> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> >> > :66)
> >> >     at
> >> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
> >> >     at
> >> > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> >> > derEndingInterceptor.handleMessage
> >> > (MessageSenderInterceptor.java:62)
> >> >     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> >> > PhaseInterceptorChain.java:207)
> >> >     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> >> >     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
> >> >     at
> >> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> >> >     at
> >> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> >> > :135)
> >> >
> >> > This means the RMProperties is not set in the message.
> >> > What could go wrong?
> >> >
> >>
> >> ----------------------------
> >> IONA Technologies PLC (registered in Ireland)
> >> Registered Number: 171387
> >> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland
> >>
> >
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

Re: WS-RM Usage

Posted by Sergey Beryozkin <se...@iona.com>.
Can it be that you enabled the policy engine too late ?

Cheers, Sergey
----- Original Message ----- 
From: "Bharath Ganesh" <bh...@gmail.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 26, 2007 5:43 AM
Subject: Re: WS-RM Usage


> My wsdl now contains the RM-Assertion and I have enabled the policy engine
> (by getting hold of PolicyEngine from the bus).
> 
> But when I invoke the webservice, I get the following message:
> 
> Failed to retrieve message addressing properties from context - not ensuring
> reliable delivery.
>  Messages Trace:
>      retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>      WS-Addressing - failed to retrieve Message Addressing Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>      retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>      WS-Addressing - failed to retrieve Message Addressing Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>      retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>      WS-Addressing - failed to retrieve Message Addressing Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>      Failed to retrieve message addressing properties from context - not
> ensuring reliable delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)
> 
> 
> What could have gone wrong?
> 
> -Bharath
> 
> 
> 
> 
> On 9/25/07, Glynn, Eoghan <eo...@iona.com> wrote:
>>
>>
>>
>> The presence of RMAssertion in the WSDL is enough for WS-RM to be
>> engaged in the client-runtime *if* the policy engine is turned on the
>> client config, via something like the following:
>>
>>     <bean id="org.apache.cxf.ws.policy.PolicyEngine"
>> class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
>>         <property name="bus" ref="cxf"/>
>>         <property name="enabled" value="true"/>
>>     </bean>
>>
>> See the ws_policy demo for an example of this usage and also the
>> docco[1] for more details.
>>
>> This automatic injection of capability into the runtime triggered by the
>> presence of policy assertions is one of the main goals of the CXF
>> WS-Policy framework[2].
>>
>> Cheers,
>> Eoghan
>>
>> [1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
>> [2] http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html
>>
>>
>> > -----Original Message-----
>> > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
>> > Sent: 25 September 2007 14:12
>> > To: cxf-user@incubator.apache.org
>> > Subject: WS-RM Usage
>> >
>> > Hi
>> >
>> > I have been trying to get WS-RM to work in CXF. These are the
>> > steps I followed.
>> >
>> > WSDL: Reference to a WS-policy, containing a RMAssertion.
>> >
>> > <wsp:Policy wsu:Id="RM">
>> >     <wsam:Addressing>
>> >         <wsp:Policy/>
>> >     </wsam:Addressing>
>> >     <wsrmp:RMAssertion>
>> >        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
>> >     </wsrmp:RMAssertion>
>> > </wsp:Policy>
>> >
>> > But this was not enough for the client side RM configuration.
>> > The RM Interceptors were not added even thought the service
>> > client (Generated JAX-WS Service class) pointed to this wsdl.
>> >
>> > So I chose to programatically get hold of the bus, enable
>> > WS-Policy, create the RMFeature, set the RM Store and add the
>> > RMInterceptors explicitly.
>> > Is that really needed? Shouldn't the runtime do this if wsdl
>> > contains a WS-Policy reference, which has a RM assertion?
>> >
>> > In added RMOutInterceptor, RMInInterceptor, RMSoapInterceptor
>> > (to in and out), RetransmissionInterceptor (to in and out) to
>> > the client side org.apache.cxf.endpoint.Endpoint.
>> >
>> > After configuring all this when the message goes outward from
>> > the client I get this exception:
>> >
>> > Caused by: java.lang.NullPointerException
>> >     at
>> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledged
>> > (RetransmissionQueueImpl.java:202)
>> >     at
>> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
>> > RetransmissionQueueImpl.java:92)
>> >     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
>> > RetransmissionCallback.java:56)
>> >     at
>> > org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
>> > :113)
>> >     at
>> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
>> > :66)
>> >     at
>> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
>> >     at
>> > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
>> > derEndingInterceptor.handleMessage
>> > (MessageSenderInterceptor.java:62)
>> >     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
>> > PhaseInterceptorChain.java:207)
>> >     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>> >     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>> >     at
>> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>> >     at
>> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
>> > :135)
>> >
>> > This means the RMProperties is not set in the message.
>> > What could go wrong?
>> >
>>
>> ----------------------------
>> IONA Technologies PLC (registered in Ireland)
>> Registered Number: 171387
>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>>
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: WS-RM Usage

Posted by "Glynn, Eoghan" <eo...@iona.com>.

The problem here seems to be that the WS-RM layer cannot retrieve the
addressing properties that WS-A layer should have stored in the context.

A couple of questions:

1. In a previous mail on this thread you talked about adding the
RMInterceptors explicitly in code - I presume you're no longer doing
this and are now just relying on the RMAssertion & Addressing policies
attached to the WSDL and the PolicyEngine config bean?

2. What version of CXF are you using? Up to quite recently, the
<wsaw:UsingAddressing> extension element was also required in the WSDL
in order to enable WS-A. Try adding the following child element to your
<wsdl:port>:

    <wswa:UsingAddressing
xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>

Cheers,
Eoghan


> -----Original Message-----
> From: Bharath Ganesh [mailto:bharathganesh@gmail.com] 
> Sent: 26 September 2007 05:43
> To: cxf-user@incubator.apache.org
> Subject: Re: WS-RM Usage
> 
> My wsdl now contains the RM-Assertion and I have enabled the 
> policy engine (by getting hold of PolicyEngine from the bus).
> 
> But when I invoke the webservice, I get the following message:
> 
> Failed to retrieve message addressing properties from context 
> - not ensuring reliable delivery.
>   Messages Trace:
>       retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>       WS-Addressing - failed to retrieve Message Addressing 
> Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>       retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>       WS-Addressing - failed to retrieve Message Addressing 
> Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>       retrieving MAPs from context property {0};(
> org.apache.cxf.ws.addressing.ContextUtils)
>       WS-Addressing - failed to retrieve Message Addressing 
> Properties from
> context;(org.apache.cxf.ws.addressing.ContextUtils)
>       Failed to retrieve message addressing properties from 
> context - not ensuring reliable 
> delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)
> 
> 
> What could have gone wrong?
> 
> -Bharath
> 
> 
> 
> 
> On 9/25/07, Glynn, Eoghan <eo...@iona.com> wrote:
> >
> >
> >
> > The presence of RMAssertion in the WSDL is enough for WS-RM to be 
> > engaged in the client-runtime *if* the policy engine is 
> turned on the 
> > client config, via something like the following:
> >
> >     <bean id="org.apache.cxf.ws.policy.PolicyEngine"
> > class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
> >         <property name="bus" ref="cxf"/>
> >         <property name="enabled" value="true"/>
> >     </bean>
> >
> > See the ws_policy demo for an example of this usage and also the 
> > docco[1] for more details.
> >
> > This automatic injection of capability into the runtime 
> triggered by 
> > the presence of policy assertions is one of the main goals 
> of the CXF 
> > WS-Policy framework[2].
> >
> > Cheers,
> > Eoghan
> >
> > [1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
> > [2] 
> http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html
> >
> >
> > > -----Original Message-----
> > > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> > > Sent: 25 September 2007 14:12
> > > To: cxf-user@incubator.apache.org
> > > Subject: WS-RM Usage
> > >
> > > Hi
> > >
> > > I have been trying to get WS-RM to work in CXF. These are 
> the steps 
> > > I followed.
> > >
> > > WSDL: Reference to a WS-policy, containing a RMAssertion.
> > >
> > > <wsp:Policy wsu:Id="RM">
> > >     <wsam:Addressing>
> > >         <wsp:Policy/>
> > >     </wsam:Addressing>
> > >     <wsrmp:RMAssertion>
> > >        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
> > >     </wsrmp:RMAssertion>
> > > </wsp:Policy>
> > >
> > > But this was not enough for the client side RM configuration.
> > > The RM Interceptors were not added even thought the 
> service client 
> > > (Generated JAX-WS Service class) pointed to this wsdl.
> > >
> > > So I chose to programatically get hold of the bus, enable 
> WS-Policy, 
> > > create the RMFeature, set the RM Store and add the RMInterceptors 
> > > explicitly.
> > > Is that really needed? Shouldn't the runtime do this if wsdl 
> > > contains a WS-Policy reference, which has a RM assertion?
> > >
> > > In added RMOutInterceptor, RMInInterceptor, 
> RMSoapInterceptor (to in 
> > > and out), RetransmissionInterceptor (to in and out) to the client 
> > > side org.apache.cxf.endpoint.Endpoint.
> > >
> > > After configuring all this when the message goes outward from the 
> > > client I get this exception:
> > >
> > > Caused by: java.lang.NullPointerException
> > >     at
> > > 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledge
> > > d
> > > (RetransmissionQueueImpl.java:202)
> > >     at
> > > 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> > > RetransmissionQueueImpl.java:92)
> > >     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> > > RetransmissionCallback.java:56)
> > >     at
> > > org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
> > > :113)
> > >     at
> > > 
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> > > :66)
> > >     at
> > > 
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
> > >     at
> > > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> > > derEndingInterceptor.handleMessage
> > > (MessageSenderInterceptor.java:62)
> > >     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > > PhaseInterceptorChain.java:207)
> > >     at 
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> > >     at 
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
> > >     at
> > > 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> > >     at
> > > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> > > :135)
> > >
> > > This means the RMProperties is not set in the message.
> > > What could go wrong?
> > >
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland) Registered Number: 
> > 171387 Registered Address: The IONA Building, Shelbourne 
> Road, Dublin 
> > 4, Ireland
> >
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: WS-RM Usage

Posted by Bharath Ganesh <bh...@gmail.com>.
My wsdl now contains the RM-Assertion and I have enabled the policy engine
(by getting hold of PolicyEngine from the bus).

But when I invoke the webservice, I get the following message:

Failed to retrieve message addressing properties from context - not ensuring
reliable delivery.
  Messages Trace:
      retrieving MAPs from context property {0};(
org.apache.cxf.ws.addressing.ContextUtils)
      WS-Addressing - failed to retrieve Message Addressing Properties from
context;(org.apache.cxf.ws.addressing.ContextUtils)
      retrieving MAPs from context property {0};(
org.apache.cxf.ws.addressing.ContextUtils)
      WS-Addressing - failed to retrieve Message Addressing Properties from
context;(org.apache.cxf.ws.addressing.ContextUtils)
      retrieving MAPs from context property {0};(
org.apache.cxf.ws.addressing.ContextUtils)
      WS-Addressing - failed to retrieve Message Addressing Properties from
context;(org.apache.cxf.ws.addressing.ContextUtils)
      Failed to retrieve message addressing properties from context - not
ensuring reliable delivery.;(org.apache.cxf.ws.rm.RMOutInterceptor)


What could have gone wrong?

-Bharath




On 9/25/07, Glynn, Eoghan <eo...@iona.com> wrote:
>
>
>
> The presence of RMAssertion in the WSDL is enough for WS-RM to be
> engaged in the client-runtime *if* the policy engine is turned on the
> client config, via something like the following:
>
>     <bean id="org.apache.cxf.ws.policy.PolicyEngine"
> class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
>         <property name="bus" ref="cxf"/>
>         <property name="enabled" value="true"/>
>     </bean>
>
> See the ws_policy demo for an example of this usage and also the
> docco[1] for more details.
>
> This automatic injection of capability into the runtime triggered by the
> presence of policy assertions is one of the main goals of the CXF
> WS-Policy framework[2].
>
> Cheers,
> Eoghan
>
> [1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
> [2] http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html
>
>
> > -----Original Message-----
> > From: Bharath Ganesh [mailto:bharathganesh@gmail.com]
> > Sent: 25 September 2007 14:12
> > To: cxf-user@incubator.apache.org
> > Subject: WS-RM Usage
> >
> > Hi
> >
> > I have been trying to get WS-RM to work in CXF. These are the
> > steps I followed.
> >
> > WSDL: Reference to a WS-policy, containing a RMAssertion.
> >
> > <wsp:Policy wsu:Id="RM">
> >     <wsam:Addressing>
> >         <wsp:Policy/>
> >     </wsam:Addressing>
> >     <wsrmp:RMAssertion>
> >        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
> >     </wsrmp:RMAssertion>
> > </wsp:Policy>
> >
> > But this was not enough for the client side RM configuration.
> > The RM Interceptors were not added even thought the service
> > client (Generated JAX-WS Service class) pointed to this wsdl.
> >
> > So I chose to programatically get hold of the bus, enable
> > WS-Policy, create the RMFeature, set the RM Store and add the
> > RMInterceptors explicitly.
> > Is that really needed? Shouldn't the runtime do this if wsdl
> > contains a WS-Policy reference, which has a RM assertion?
> >
> > In added RMOutInterceptor, RMInInterceptor, RMSoapInterceptor
> > (to in and out), RetransmissionInterceptor (to in and out) to
> > the client side org.apache.cxf.endpoint.Endpoint.
> >
> > After configuring all this when the message goes outward from
> > the client I get this exception:
> >
> > Caused by: java.lang.NullPointerException
> >     at
> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledged
> > (RetransmissionQueueImpl.java:202)
> >     at
> > org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> > RetransmissionQueueImpl.java:92)
> >     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> > RetransmissionCallback.java:56)
> >     at
> > org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
> > :113)
> >     at
> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> > :66)
> >     at
> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
> >     at
> > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> > derEndingInterceptor.handleMessage
> > (MessageSenderInterceptor.java:62)
> >     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > PhaseInterceptorChain.java:207)
> >     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> >     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
> >     at
> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> >     at
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> > :135)
> >
> > This means the RMProperties is not set in the message.
> > What could go wrong?
> >
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

Re: WS-RM Usage

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

One thing I'd like to note is that we'll do some work to automatically enable the policy engine upon encountering
the policy expressions.

Cheers, Sergey

----- Original Message ----- 
From: "Glynn, Eoghan" <eo...@iona.com>
To: <cx...@incubator.apache.org>
Sent: Tuesday, September 25, 2007 2:30 PM
Subject: RE: WS-RM Usage




The presence of RMAssertion in the WSDL is enough for WS-RM to be
engaged in the client-runtime *if* the policy engine is turned on the
client config, via something like the following:

    <bean id="org.apache.cxf.ws.policy.PolicyEngine"
class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
        <property name="bus" ref="cxf"/>
        <property name="enabled" value="true"/>
    </bean>

See the ws_policy demo for an example of this usage and also the
docco[1] for more details.

This automatic injection of capability into the runtime triggered by the
presence of policy assertions is one of the main goals of the CXF
WS-Policy framework[2].

Cheers,
Eoghan

[1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
[2] http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html


> -----Original Message-----
> From: Bharath Ganesh [mailto:bharathganesh@gmail.com] 
> Sent: 25 September 2007 14:12
> To: cxf-user@incubator.apache.org
> Subject: WS-RM Usage
> 
> Hi
> 
> I have been trying to get WS-RM to work in CXF. These are the 
> steps I followed.
> 
> WSDL: Reference to a WS-policy, containing a RMAssertion.
> 
> <wsp:Policy wsu:Id="RM">
>     <wsam:Addressing>
>         <wsp:Policy/>
>     </wsam:Addressing>
>     <wsrmp:RMAssertion>
>        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
>     </wsrmp:RMAssertion>
> </wsp:Policy>
> 
> But this was not enough for the client side RM configuration. 
> The RM Interceptors were not added even thought the service 
> client (Generated JAX-WS Service class) pointed to this wsdl.
> 
> So I chose to programatically get hold of the bus, enable 
> WS-Policy, create the RMFeature, set the RM Store and add the 
> RMInterceptors explicitly.
> Is that really needed? Shouldn't the runtime do this if wsdl 
> contains a WS-Policy reference, which has a RM assertion?
> 
> In added RMOutInterceptor, RMInInterceptor, RMSoapInterceptor 
> (to in and out), RetransmissionInterceptor (to in and out) to 
> the client side org.apache.cxf.endpoint.Endpoint.
> 
> After configuring all this when the message goes outward from 
> the client I get this exception:
> 
> Caused by: java.lang.NullPointerException
>     at 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledged
> (RetransmissionQueueImpl.java:202)
>     at 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> RetransmissionQueueImpl.java:92)
>     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> RetransmissionCallback.java:56)
>     at 
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
> :113)
>     at 
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> :66)
>     at 
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
>     at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> derEndingInterceptor.handleMessage
> (MessageSenderInterceptor.java:62)
>     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:207)
>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>     at 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>     at 
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> :135)
> 
> This means the RMProperties is not set in the message.
> What could go wrong?
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: WS-RM Usage

Posted by "Glynn, Eoghan" <eo...@iona.com>.

The presence of RMAssertion in the WSDL is enough for WS-RM to be
engaged in the client-runtime *if* the policy engine is turned on the
client config, via something like the following:

    <bean id="org.apache.cxf.ws.policy.PolicyEngine"
class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
        <property name="bus" ref="cxf"/>
        <property name="enabled" value="true"/>
    </bean>

See the ws_policy demo for an example of this usage and also the
docco[1] for more details.

This automatic injection of capability into the runtime triggered by the
presence of policy assertions is one of the main goals of the CXF
WS-Policy framework[2].

Cheers,
Eoghan

[1] http://cwiki.apache.org/CXF20DOC/wspconfiguration.html
[2] http://cwiki.apache.org/CXF20DOC/ws-policy-framework-overview.html


> -----Original Message-----
> From: Bharath Ganesh [mailto:bharathganesh@gmail.com] 
> Sent: 25 September 2007 14:12
> To: cxf-user@incubator.apache.org
> Subject: WS-RM Usage
> 
> Hi
> 
> I have been trying to get WS-RM to work in CXF. These are the 
> steps I followed.
> 
> WSDL: Reference to a WS-policy, containing a RMAssertion.
> 
> <wsp:Policy wsu:Id="RM">
>     <wsam:Addressing>
>         <wsp:Policy/>
>     </wsam:Addressing>
>     <wsrmp:RMAssertion>
>        <wsrmp:BaseRetransmissionInterval Milliseconds="10000"/>
>     </wsrmp:RMAssertion>
> </wsp:Policy>
> 
> But this was not enough for the client side RM configuration. 
> The RM Interceptors were not added even thought the service 
> client (Generated JAX-WS Service class) pointed to this wsdl.
> 
> So I chose to programatically get hold of the bus, enable 
> WS-Policy, create the RMFeature, set the RM Store and add the 
> RMInterceptors explicitly.
> Is that really needed? Shouldn't the runtime do this if wsdl 
> contains a WS-Policy reference, which has a RM assertion?
> 
> In added RMOutInterceptor, RMInInterceptor, RMSoapInterceptor 
> (to in and out), RetransmissionInterceptor (to in and out) to 
> the client side org.apache.cxf.endpoint.Endpoint.
> 
> After configuring all this when the message goes outward from 
> the client I get this exception:
> 
> Caused by: java.lang.NullPointerException
>     at 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.cacheUnacknowledged
> (RetransmissionQueueImpl.java:202)
>     at 
> org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.addUnacknowledged(
> RetransmissionQueueImpl.java:92)
>     at org.apache.cxf.ws.rm.RetransmissionCallback.onClose(
> RetransmissionCallback.java:56)
>     at 
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java
> :113)
>     at 
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java
> :66)
>     at 
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
>     at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSen
> derEndingInterceptor.handleMessage
> (MessageSenderInterceptor.java:62)
>     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:207)
>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>     at 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>     at 
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> :135)
> 
> This means the RMProperties is not set in the message.
> What could go wrong?
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland