When using two-way Web service communications using SOAP over JMS,
it can be beneficial to configure a permanent replyTo queue on a JAX-RPC Web
services client to prevent the client from having to create a temporary reply
queue each time a Web service request is made.
About this task
newfeat Important: The WebSphere Application Server Version
6.1 Feature Pack for Web Services extends the capabilities of this product
to introduce support for the Java API for XML-Based Web Services (JAX-WS)
2.0 programming model. JAX-WS is the next generation Web services programming
model complimenting the foundation provided by the Java API for XML-based
RPC (JAX-RPC) programming model. Using the strategic JAX-WS programming model,
development of Web services and clients is simplified through support of a
standards-based annotations model. Although the JAX-RPC programming model
and applications are still supported, take advantage of the easy-to-implement
JAX-WS programming model to develop new Web services applications and clients.
newfeat Supported configurations: The Feature Pack for Web Services does not support
Java Message Service (JMS) transports or enterprise beans. This product only
supports an HTTP transport and hosting JavaBeans endpoints within the Web
container for JAX-WS Web services applications. To develop enterprise beans
hosted as Web services, you must use the JAX-RPC programming model. This product
does allow JAX-WS clients to issue requests from any of the Java Platform,
Enterprise Edition (Java EE) containers along with the client Java 2 Standard
Edition (J2SE) environment.sptcfg
A permanent
replyTo queue is configured on the Web service client in one of the following
ways:
- Specify the optional replyToDestination property in the
JMS endpoint URL.
- Set the replyTo queue programmatically on the client JAX-RPC Stub or Call
object. Setting the replyTo queue as a Stub or a Call property affects all
requests that are invoked using that Stub or Call object.
- Set the replyTo queue as a JVM System property. Setting the replyTo queue
as a JVM System property affects all of your SOAP over JMS clients running
in the particular JVM. If there are multiple clients in the same application
that need to use a different replyTO queue, then the best option is to set
the property programmatically.
Note: To set the permanent replyTo queue using any of these options,
only client-side configuration is necessary. There is no configuration necessary
on the Web service provider side.
Procedure
- Specify the optional replyToDestination property
in the JMS endpoint URL.
jms:/queue?destination=jms/MyRequestQueue&connectionFactory=
jms/MyCF&replyToDestination=jms/MyReplyQueue&targetService=MyService
- Set the replyTo queue programmatically on the client JAX-RPC Stub
or Call object.
The client uses the JAX-RPC Stub or Call object
to invoke the Web service.
((javax.xml.rpc.Stub)stub)._setProperty(com.ibm.wsspi.webservices.Consta
nts.JMS_REPLY_QUEUE_JNDI_NAME,
"jms/Permanent_Q");
The value of the property is a String.
- Set the replyTo queue as a JVM System property.
Results
Your Web services client can now receive SOAP/JMS messages to a permanent
replyTo queue.