|
Page Created :
CXF20DOC :
WSRMConfiguration
WSRMConfiguration has been created by Andrea Smyth (Aug 03, 2007). Content:Using WS-Reliable MessagingIn order for a client/server to communicate reliably with its target endpoint/its clients, the CXF WS-Reliable Messaging interceptors need to be in the interceptor chain for inbound and outbound messages and faults. Also, because WS-Reliable Messaging depends on WS-Addressing, the CXF WS-Addressing interceptors need to be on these interceptor chains. You need to ensure that the CXF's policy engine is enabled: <bean id="org.apache.cxf.ws.policy.PolicyEngine" class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine"> The attachment of a <wsp:Policy> element containing an <wsrmp:RMAssertion> element (or a <wsp:PolicyReference element referencing such an element) is then sufficient to enable the use of Reliable Messaging, i.e. it causes the Reliable Messaging interceptors to be added to the appropriate interceptor chains. Note that the <wsp:Policy> or <wsp:PolicyReference> elements need not be necessarily be attached to wsdl elements but can also appear in the form of external attachments, see WS-Policy - How it Works. The PolicyEngine can also be enabled by using the WS-Policies Feature - that way you need not be aware of the policy engine's implementation class and its relation to the bus: <jaxws:endpoint ...> <jaxws:features> <p:policies/> </jaxws:features> </bean> Also, <wsp:Policy> or <wsp:PolicyReference> element can appear as child elements of the policies feature, having the same effect as if they were attached to the wsdl:element representing the endpoint: {code:xml} <jaxws:endpoint ...> <jaxws:features> <p:policies xmlns:p="> <wsp:Policy xmlns:wsp="http://www.w3.org/2006/07/ws-policy"> <wsp:All> <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="30000"/> </wsrmp:RMAssertion> </wsp:All> </wsp:Policy> <p:/policies> </jaxws:features> </bean> Enabling and Configuring WS-Reliable Messaging using the WS-Reliable Messaging Feature TODO Enabling and Configuring WS-Reliable Messaging using Beans To ensure that the Reliable Messaging interceptors are added to the appropriate interceptor chains, e.g. for all client and server endpoints: <bean id="rmLogicalOut" class="org.apache.cxf.ws.rm.RMOutInterceptor"> <property name="bus" ref="cxf"/> </bean> <bean id="rmLogicalIn" class="org.apache.cxf.ws.rm.RMInInterceptor"> <property name="bus" ref="cxf"/> </bean> <bean id="rmCodec" class="org.apache.cxf.ws.rm.soap.RMSoapInterceptor"/> <cxf:bus ...> <cxf:inInterceptors> <ref bean="rmLogicalIn"/> <ref bean="rmCodec"/> </cxf:inInterceptors> <cxf:inFaultInterceptors> <ref bean="rmLogicalIn"/> <ref bean="rmCodec"/> </cxf:inFaultInterceptors> <cxf:outInterceptors> <ref bean="rmLogicalOut"/> <ref bean="rmCodec"/> </cxf:outInterceptors> <cxf:outFaultInterceptors> <ref bean="rmLogicalOut"/> <ref bean="rmCodec"/> <cxf:outFaultInterceptors> </cxf:bus> The RetransmissionIntercepor will be added on the fly by the RMOutInterceptor so need not appear in your configuration file. To configure properties of the RM Manager, you can use the rmManager element from the http://cxf.apache.org/ws/rm/manager namespace. It supports the following child elements: Element Value sourcePolicy ... destinationpolicy ... rmAssertion ... store The RM store. This must be a bean or a reference to a bean that implements the org.apache.cxf.ws.rm.persistence.RMStore. To enable persistence, you must specify the class implementing the persistent store for RM. You can develop your own, or use the JDBC based store that comes with CXF (class org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore that is). In that case, you may need to configure the driver class and connection parameters: Property Name Type Default driverClassName String org.apache.derby.jdbc.EmbeddedDriver userName String null passWord String null url String jdbc:derby:rmdb;create=true Example: {code:xml} <bean class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore"> <property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver"/> <property name="url" value="jdbc:derby://localhost:1527/rmdb;create=true"/> <property name="password" value="password"/> </bean> <wsrm-mgr:rmManager xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"> <property name="store" ref="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore"/> </wsrm-mgr:rmManager> |
Unsubscribe or edit your notifications preferences
