WebSphere WebSphere Application Server Network Deployment, Version 6.1.x Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

Example: Pausing a WS-Notification subscription

Example code that describes a client acting in the subscriber role, pausing a subscription for a consumer application.

This example is based on using the Java API for XML-based remote procedure call (JAX-RPC) APIs in conjunction with code generated using the WSDL2Java tool (run against the Subscription Manager WSDL generated as a result of creating your WS-Notification service point) and WebSphere Application Server APIs and SPIs.

// Look up the JAX-RPC service. The JNDI name is specific to your Web services client implementation.
// The PauseSubscription operation belongs to the SubscriptionManager service
InitialContext context = new InitialContext();
javax.xml.rpc.Service service = (javax.xml.rpc.Service) context.lookup("java:comp/env/services/SubscriptionManager");

// Get a stub for the port on which you want to invoke operations
SubscriptionManager stub = (SubscriptionManager) service.getPort(SubscriptionManager.class);

// Associate the request with the subscription you want to pause. The subscriptionEPR is the
// EndpointReference returned by the invocation of the Subscribe operation
((Stub) stub)._setProperty(WSAConstants.WSADDRESSING_DESTINATION_EPR, subscriptionEPR);

// Create any optional information
SOAPElement[] optionalInformation =  new SOAPElement[] {};

// Invoke the PauseSubscription operation by calling the associated method on the stub
SOAPElement[] additionalReturnedInformation = stub.pauseSubscription(optionalInformation);
Related concepts
JAX-RPC
Related tasks
Writing a WS-Notification application that exposes a Web service endpoint
Writing a WS-Notification application that does not expose a Web service endpoint
WS-Notification - publish and subscribe messaging for Web services
Learning about WS-Notification
Securing WS-Notification
Related reference
Example: Subscribing a WS-Notification consumer
Example: Publishing a WS-Notification message
Example: Creating a WS-Notification pull point
Example: Getting messages from a WS-Notification pull point
Example: Registering a WS-Notification publisher
Example: Notification consumer Web service skeleton
Sharing event notification messages with other bus client applications
WSDL2Java command
WS-Notification troubleshooting tips

Reference topic

Terms of use | Feedback


Timestamp icon Last updated: 26 February 2009
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.pmc.nd.multiplatform.doc/ref/rjwsn_ex_sub_pause.html

Copyright IBM Corporation 2004, 2009. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)