Develop a reliable web service application
Develop a JAX-WS provider or requester application that can compose with a WS-ReliableMessaging-enabled policy set.
At any stage - that is, before or after we have built the reliable web service application, or configured the policy sets - we can set a property that configures endpoints to only support clients that use reliable messaging. This setting is reflected by WS-Policy if engaged.
We can develop a JAX-WS web service requester application that sends messages reliably, or a web service provider application that requires reliable messaging. Your client application can also take programmatic control of WS-ReliableMessaging sequences.
- Develop your JAX-WS web service application.
For a Web service requester application that sends messages reliably:
- Get an implementation WSDL document, and select the SOAP over HTTP binding. The WSDL should be WS-I Basic Profile compliant.
- Build the JAX-WS application from the WSDL implementation document.
- Optional. Enable transaction support for outbound (requester) one-way message sends. For more information, see Provide transactional recoverable messaging through WS-ReliableMessaging.
- Optional. Use the waitUntilSequenceCompleted method on the sequenceManager to ensure that reliable messaging state is released after the client finishes messaging, as described in the Controlling WS-ReliableMessaging sequences programmatically topic.
- Optional. To use in-order delivery (that is, we want WS-ReliableMessaging to make messages available to the requester application in the order that they were sent), then you must also configure the requester application to poll for the messages in the order in which it should receive them. For more information, see Configure the WS-ReliableMessaging policy.
For a web service provider application that requires reliable messaging:
- Write or get an interface WSDL document that describes the service interface. The document should be compliant with the WS-I Basic Profile.
- Write or get an implementation WSDL document, and select the SOAP over HTTP binding. The WSDL should remain WS-I Basic Profile compliant.
- Build the JAX-WS application from the WSDL implementation document.
- Enable the client application to take programmatic control of WS-ReliableMessaging sequences.
This helps manage resources on the server, for example by removing sequences after a client application has finished messaging. We can add code to create sequences, send acknowledgement requests, close sequences, terminate sequences and wait until sequences are complete. For more information, including example code, see Controlling WS-ReliableMessaging sequences programmatically.
What to do next
We are now ready to configure a policy set instance to enable WS-ReliableMessaging.
Subtopics
- Controlling WS-ReliableMessaging sequences programmatically
Your client application can use the WSRMSequenceManager, part of the WAS SPI for reliable messaging, to gain programmatic control over reliable messaging sequences. This helps manage resources on the server, for example by removing sequences after a client application has finished messaging. We can add code to create sequences, send acknowledgement requests, close sequences, terminate sequences and wait until sequences are complete.
- Provide transactional recoverable messaging through WS-ReliableMessaging
If wer WS-ReliableMessaging application runs inside the web container and uses a managed quality of service, we can use WS-ReliableMessaging to provide transactional recoverable messaging.
- Configure endpoints to only support clients that use WS-ReliableMessaging
By default, when a WS-ReliableMessaging enabled policy set is attached to an endpoint, the server supports clients that use reliable messaging and clients that do not use reliable messaging. In this version of the product, we can configure endpoints to only support clients that use reliable messaging.
Related concepts
JAX-WS application deployment model
Related tasks
Add assured delivery to web services through WS-ReliableMessaging WS-ReliableMessaging Configure endpoints to only support clients that use WS-ReliableMessaging Detecting and fixing problems with WS-ReliableMessaging
WS-ReliableMessaging - requirements for interaction with other implementations