Hi I had created SOAP web service with apache CXF 3.0.4
and spring4.0
and its working fine for me and created with wsdl file.
Now i want to add extra feature of Apache CXF
about WS-RM
(web service Reliable Messaging) to this web service.
I try to add some code like enable WS-Addressing
first and then define Policy in it but i don't get any approach to do so.
Please share your idea.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:wsa="http://cxf.apache.org/ws/addressing"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="test" class="com.msp.webservices.impl.TestWSImpl"
scope="prototype"></bean>
<jaxws:endpoint id="testService" implementor="#test"
address="/TestService" publishedEndpointUrl="${tomcat.url}/${context.name}/TestService">
<jaxws:properties>
<entry key="mtom-enabled" value="true" />
</jaxws:properties>
</jaxws:endpoint>
<cxf:bus>
<cxf:features>
<wsa:addressing/>
<wsrm-mgr:reliableMessaging>
<wsrm-policy:RMAssertion>
<wsrm-policy:BaseRetransmissionInterval Milliseconds="4000"/>
<wsrm-policy:AcknowledgementInterval Milliseconds="2000"/>
</wsrm-policy:RMAssertion>
<wsrm-mgr:sourcePolicy>
<wsrm-mgr:sequenceTerminationPolicy maxLength="5"/>
</wsrm-mgr:sourcePolicy>
<wsrm-mgr:destinationPolicy acceptOffers="false">
</wsrm-mgr:destinationPolicy>
</wsrm-mgr:reliableMessaging>
</cxf:features>
</cxf:bus>
</beans>
Extra Code added to context file It fails while deploying on tomcat.
And on startup its try to createSequence which throws exception.
Here is console log.
Nov 00, 2015 00:00:00 AM org.apache.cxf.ws.rm.Proxy invoke
INFO: Sending out-of-band RM protocol message {http://schemas.xmlsoap.org/ws/2005/02/rm}CreateSequence.
Nov 00, 2015 00:00:00 AM org.apache.cxf.services.SequenceAbstractService.SequenceAbstractSoapPort.SequenceAbstractPortType
INFO: Outbound Message
---------------------------
ID: 1
Encoding: UTF-8
Content-Type: application/soap+xml; action="http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence"
Headers:
Payload: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:tns="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"><soap:Header><Action xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</Action><MessageID xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">urn:uuid:6394efee-06ca-44c3-a165-38112b4f9b71</MessageID><To xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">soap.udp://239.255.255.250:3702</To></soap:Header><soap:Body><CreateSequence xmlns:ns2="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns="http://schemas.xmlsoap.org/ws/2005/02/rm"><AcksTo><ns2:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</ns2:Address></AcksTo><Expires>PT0S</Expires><Offer><Identifier>urn:uuid:ce23294b-3117-450a-89f2-d35d013b33d2</Identifier><Expires>PT0S</Expires></Offer></CreateSequence></soap:Body></soap:Envelope>
--------------------------------------
Nov 00, 2015 00:00:00 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://schemas.xmlsoap.org/ws/2005/02/rm}SequenceAbstractService#{http://schemas.xmlsoap.org/ws/2005/02/rm}CreateSequence has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
.
.
.
.
.
Nov 00, 2015 00:00:00 AM org.apache.cxf.ws.rm.Proxy invoke
SEVERE: Failed to send RM protocol message {http://schemas.xmlsoap.org/ws/2005/02/rm}CreateSequence.
org.apache.cxf.interceptor.Fault: Could not send Message.
.
.
.
.
It works fine while configuring cxf2.5.4 version but i want to use cxf3.0.4