Use the enableTransactionalOneWay property to ensure that one-way
JAX-RPC Web service requests using the JMS transport will be sent to the destination
queue or topic transactionally.
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
The enableTransactionalOneWay property
is applicable for WebSphere Application Server V6.0.2 Service Release 9 and
later.
When using JMS to transport Web service requests, the default
behavior is for the SOAP message to be added to the destination queue or topic
non-transactionally or outside of the client application's transaction. Adding
the SOAP message to the destination queue or topic is done outside of the
transaction to avoid synchronization problems that can occur with two-way
Web service requests. However, you can choose to allow one-way requests to
be processed as part of the transaction. The enableTransactionalOneWay property
can be used to ensure that one-way Web service requests that use the JMS transport
will be sent to the destination queue or topic transactionally. When the
client application invokes the one-way Web service request, the resulting
SOAP request message is added to the destination queue or topic as part of
the client application's transaction.
Use one of the following ways
to enable the enableTransactionalOneWay property.
Procedure
- Set the enableTransactionalOneWay property programmatically
on the client JAX-RPC Stub or Call object.
When using a static
Stub to invoke the Web service operation, set the enableTransactionalOneWay property
on the Stub object before invoking the Web service method. When using a Call
object to invoke the Web service operation, set the enableTransactionalOneWay property
on the Call object before invoking the invokeOneWay() method.
Service service = /* Obtain the desired service */
MyStub stub = service.getPort();
/* Set enableTransactionalOneWay property on Stub */
stub._setProperty(com.ibm.websphere.webservices.Constants.ENABLE_TRAN_ONEWAY, new Boolean(true));
/* Invoke the one-way operation */
stub.myOneWayOperation("Parm1");
The value of the property is Boolean.
- Set the enableTransactionalOneWay property as
a custom property in the ibm-webservicesclient-bnd.xmi deployment
descriptor file by using the wsadmin command.
For more
information about the wsadmin tool options, review Options for the AdminApp object install, installInteractive,
edit, editInteractive, update, and updateInteractive commands.
Use
the $AdminApp object along with the -WebServicesClientCustomProperty option
to set the value of the property within the client binding file, ibm-webservicesclient-bnd.xmi.
The value of the custom property, enableTransactionalOneWay ,
should be either true or false.
- Using Jacl:
$AdminApp edit MyApplication {-WebServicesClientCustomProperty
{{MyEJBJar.jar MyEJB service/MyServiceRef MyPort enableTransactionalOneWay
true}}}
- Using Jython:
AdminApp.edit('MyApplication', ['-WebServicesClientCustomProperty',
[['MyEJBJar.jar', 'MyEJB', 'service/MyServiceRef ', 'MyPort', 'enableTransactionalOneWay',
'true']]])
Results
You have a Web service client application that is configured to invoke
one-way requests transactionally while using the JMS transport.
What to do next
After you have enabled the enableTransactionalOneWay property,
run the client application.