Example: Creating a WS-Notification pull point

Example code that describes a client acting in the subscriber role, creating a pull point for use by a consumer application that wants to use pull style notifications.

Example

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 Notification Broker 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
InitialContext context = new InitialContext();
javax.xml.rpc.Service service = (javax.xml.rpc.Service) context.lookup(
    "java:comp/env/services/NotificationBroker");

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

// Create the request information. 
SOAPElement[] optionalInformation = null;
CreatePullPoint cpp = new CreatePullPoint(optionalInformation);

// Invoke the CreatePullPoint operation by calling the associated method on the stub
CreatePullPointResponse response = stub.createPullPoint(cpp);

// Retrieve the reference to the pull point from the response
EndpointReference pullPointEPR = response.getPullPoint();

// Retrieve any additional information from the response
SOAPElement[] additionalInformation = response.getElements();



Related concepts
JAX-RPC
Learning about WS-Notification
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
Securing WS-Notification
Developing applications that use WS-Notification
Related reference
Example: Subscribing a WS-Notification consumer
Example: Pausing a WS-Notification subscription
Example: Publishing a WS-Notification message
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
WS-Notification troubleshooting tips
Related information
WSDL2Java command for JAX-RPC applications
Reference topic    

Terms of Use | Feedback

Last updated: Feb 19, 2011 5:25:36 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v610web&product=was-nd-mp&topic=rjwsn_ex_pp_create
File name: rjwsn_ex_pp_create.html