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);