Eoghan:

Thanks for the help, here is where I am so far...

<Quote>
You're getting these errors on the server-side right?
</Quote>
Yes.

<Quote>
Are you using WSDL-first or Java-first?
If WSDL-first, does your WSDL include the <wsam:UsingAddressing>
extension element? (see the ws_rm sample WSDL)
</Quote>
WSDL-first. I am actually using the ws-rm samples WSDL.

<Quote>
Which implies that WS-A (and possibly WS-RM also) is not being properly
enabled on the client-side.
</Quote>

Funny thing, I dumped the interceptors on the client and there are
none...
                SpringBusFactory bf = new SpringBusFactory();
                Bus bus = bf.createBus("cxf_rm_client.xml");
                bf.setDefaultBus(bus);            

                List<Interceptor> inList = bus.getInInterceptors();
            System.out.println("Num In Interceptors:"+inList.size()); 
                // Num In Interceptors:0


            List<Interceptor> outList = bus.getOutInterceptors();
            System.out.println("Num Out Interceptors:"+outList.size());
                // Num Out Interceptors:0

I added them via code as follows:
            inList.add(new
org.apache.cxf.interceptor.LoggingInInterceptor());
            inList.add(new
org.apache.cxf.ws.addressing.MAPAggregator());
            inList.add(new
org.apache.cxf.ws.addressing.soap.MAPCodec());
            inList.add(new org.apache.cxf.ws.rm.RMInInterceptor());
            inList.add(new
org.apache.cxf.ws.rm.soap.RMSoapInterceptor());

            outList.add(new
org.apache.cxf.interceptor.LoggingOutInterceptor());
            outList.add(new
org.apache.cxf.ws.addressing.MAPAggregator());
            outList.add(new
org.apache.cxf.ws.addressing.soap.MAPCodec());
            outList.add(new org.apache.cxf.ws.rm.RMOutInterceptor());
            outList.add(new
org.apache.cxf.ws.rm.soap.RMSoapInterceptor());


Does it matter what order I add the Interceptors?


Doing this I get the following errors (client side - there is nothing on
the server):

        Jun 27, 2008 10:11:51 AM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
        INFO: Creating Service
{http://cxf.apache.org/hello_world_soap_http}GreeterService from WSDL:
file:src/wsdl/hello_world_rm.wsdl
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
        INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.MAPAggregator getMAPs
        INFO: MAPs retrieved from message null
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.ContextUtils storeMAPs
        INFO: associating MAPs with context property
javax.xml.ws.addressing.context.outbound
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
        INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.outbound
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
        INFO: current MAPs [MessageId:
urn:uuid:9ab9a836-ccf9-4bd0-b0b1-1d6c9b73f01c, Action:
http://cxf.apache.org/hello_world_soap_http/Greeter/sayHiRequest, To:
http://localhost:9000/SoapContext/GreeterPort, ReplyTo:
http://www.w3.org/2005/08/addressing/anonymous,         FaultTo:
http://www.w3.org/2005/08/addressing/anonymous]
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
        INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.outbound
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
        INFO: current MAPs [MessageId:
urn:uuid:9ab9a836-ccf9-4bd0-b0b1-1d6c9b73f01c, Action:
http://cxf.apache.org/hello_world_soap_http/Greeter/sayHiRequest, To:
http://localhost:9000/SoapContext/GreeterPort, ReplyTo:
http://www.w3.org/2005/08/addressing/anonymous,         FaultTo:
http://www.w3.org/2005/08/addressing/anonymous]
        Jun 27, 2008 10:11:52 AM
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
        INFO: Interceptor has thrown exception, unwinding now
        java.lang.NullPointerException
                at
org.apache.cxf.ws.rm.AbstractRMInterceptor.getManager(AbstractRMIntercep
tor.java:56)

Any ideas on what causes this error?

Right now I am using the CXF logging to look for the WS-A and WS-RM
elements in the SOAP to verify that all is working. I have used TCPMON
in the past and will try that too.

PS: sorry for the double post...

Mike Barlotta
Associate
Booz | Allen | Hamilton

-----Original Message-----
From: Eoghan Glynn [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2008 5:50 AM
To: [email protected]
Subject: Re: WS-RM enabling in CXF

Barlotta, Michael [USA] wrote:
> After digging and playing there are at least two options (there may be
> more) to configure WS-RM
> 1) adding interceptors to the CXF bus
> 2) adding policy to the endpoint
>
> I have not gotten very far with option 1, though I am not sure why.
> The Greeter service from the samples ws-rm directory works, but no
> addressing/reliable messaging calls are taking place.
>
> I have switched to using WS-Policy. (attached is the server side
> Spring context file).
> I still get the addressing errors...
>
> 16:13:59,096 ERROR [STDERR] Jun 26, 2008 4:13:59 PM
> org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
> WARNING: WS-Addressing - failed to retrieve Message Addressing
> Properties from context
>
>
> I also get this error:
> 16:13:59,346 ERROR [STDERR] Jun 26, 2008 4:13:59 PM
> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: None of the policy alternatives can
> be satisfied.
>         at
> org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(Abstr
> ac
> tPolicyInterceptor.java:58)



Mike,

You're getting these errors on the server-side right?

This implies that WS-A is indeed enabled on the server-side, but the
headers that WS-A expects are missing from the incoming request payload.

Which implies that WS-A (and possibly WS-RM also) is not being properly
enabled on the client-side.

You can confirm this by interposing tcpmon between client and server so
as to inspect the payload. Details on how to do this were discussed on
these lists recently[1]. Or can you just look at the server-side logging
output, if the <cxf:logging/> feature is set on the endpoint. You'll be
looking for WS-A elements in the <soap:Header>, such as <MessageID> and
<ReplyTo>, also for WS-RM elements such as <wsrm:Sequence>.

Assuming it turns out that the WS-A/RM headers are indeed missing from
the client's request payload, the next step is to figure out why.

Are you using WSDL-first or Java-first?

If WSDL-first, does your WSDL include the <wsam:UsingAddressing>
extension element? (see the ws_rm sample WSDL)

If Java-first, try enabling WS-A by setting the <wsam:Addressing>
policy, *OR* the CXF <wsa:addressing> feature, on the <jaxws:client>
bean in the client config (instead of manually adding the interceptors
to the Bus-level chains).

Cheers,
Eoghan

[1] http://www.nabble.com/View-SOAP-Messages-to17812716.html#a17820449



> Similar to this JIRA issue: (though I did not add the policy to the
> WSDL, I am using the one supplied in the samples directory of CXF)
> http://issues.apache.org/jira/browse/CXF-1311
>
> This is what the client looks like: the client Spring file is similar
> to the one posted earliar (interceptors attached to the bus).
>
>             SpringBusFactory bf = new SpringBusFactory();
>             Bus bus = bf.createBus("cxf_rm_client.xml");
>             bf.setDefaultBus(bus);
>            
>               GreeterService service = new GreeterService();
>               Greeter port = service.getGreeterPort();
>
>               // Use Proxy Instance as BindingProvider
>               BindingProvider bp = (BindingProvider) port;
>               // enable MTOM
>               SOAPBinding binding = (SOAPBinding)bp.getBinding();
>               binding.setMTOMEnabled(false);
>               // (Optional) Configure RequestContext with endpoint's
URL
>               Map<String, Object> rc = bp.getRequestContext();
>               rc.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
> SERVICE_ADDRESS);
>               rc.put(SOAPBinding.SOAP12HTTP_BINDING,true);
>
>             String response = port.sayHi();
>
> Thanks,
>
> Mike Barlotta
> Associate
> Booz | Allen | Hamilton
>


Reply via email to