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(Abstrac
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
-----Original Message-----
From: Barlotta, Michael [USA]
Sent: Wednesday, June 25, 2008 5:56 PM
To: '[email protected]'
Subject: WS-RM enabling in CXF
CXF Users:
I am trying to learn WS-RM and have looked at CXF 2.0.7 and the samples.
I have tried to take the existing sample (ws-rm) and port the
Server-side service into Jboss, calling it from a stand-alone WS Client.
Right now both client and server are CXF.
The client can call the service, however the WS-Addressing and WS-RM do
not seem to be enabled.
Here is the console logging:
17:47:12,140 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.interceptor.L oggingInInterceptor logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {connection=[keep-alive], cache-control=[no-cache],
host=[localhost:808 0], user-agent=[Java/1.5.0_12],
transfer-encoding=[chunked], pragma=[no-cache], content-type=[text/xml;
charset=UTF-8], accept=[*], soapaction=[""]}
Messages:
Message:
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><
soap:Body><sayHi
xmlns="http://cxf.apache.org/hello_world_soap_http/types"/></so
ap:Body></soap:Envelope>
--------------------------------------
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.inbo
und
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: WS-Addressing - failed to retrieve Message Addressing Properties
from cont ext
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .soap.MAPCodec unmarshalMAPs
INFO: Inbound WS-Addressing headers
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.inbo
und
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.inbo
und
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.inbo
und
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .MAPAggregator getMAPs
INFO: MAPs retrieved from message null
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
demo.ws_rm.server.GreeterImp l sayHi
INFO: Executing operation sayHi
17:47:12,156 INFO [STDOUT] Executing operation sayHi
17:47:12,156 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.inbo
und
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .MAPAggregator getMAPs
INFO: MAPs retrieved from message null
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.outb
ound
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.outb
ound
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.rm.RMOutIn terceptor handle
WARNING: Failed to retrieve message addressing properties from context -
not ens uring reliable delivery.
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
INFO: retrieving MAPs from context property
javax.xml.ws.addressing.context.outb
ound
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.ws.addressing .ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing
Properties from c ontext
17:47:12,171 ERROR [STDERR] Jun 25, 2008 5:47:12 PM
org.apache.cxf.interceptor.L oggingOutInterceptor$LoggingCallback
onClose
INFO: Outbound Message
---------------------------
Encoding: UTF-8
Headers: {SOAPAction=[""]}
Messages:
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><
soap:Body><sayHiResponse
xmlns="http://cxf.apache.org/hello_world_soap_http/type
s"><responseType>Bonjour</responseType></sayHiResponse></soap:Body></soa
p:Envelo
pe>
--------------------------------------
I have read through the online docs and the FUSE deployment guide.
Attached is my Spring configuration file.
Can someone tell me what I am missing.
Thanks,
Mike Barlotta
Associate
Booz | Allen | Hamilton
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland