Java Reference
In-Depth Information
Configuring
a
Java
Web
Service
with
Reliable
Messaging on WebLogic
Problem
You want to deploy your service with reliable messaging support to WebLogic 10, and you
don't want to write WSDL code by hand.
Solution
Use one of the pre-packaged policy files that comes with WebLogic 10. You can use the pro-
prietary @Policy annotation to associate one of their policy files with the class. Then set up a
JMS queue and store-and-forward agent to hold the messages.
Discussion
Example 13-3 is a class that runs only in WebLogic that handles WS-RM for you without for-
cing you to write WSDL code by hand.
Example13-3.HelloRM.java, a reliable messaging web service
package com.soacookbook;
import javax.jws.WebService;
import weblogic.jws.Policy;
import weblogic.jws.ReliabilityBuffer;
@WebService
@Policy(attachToWsdl=true,
direction=Policy.Direction.both,
uri="DefaultReliability.xml")
public class ReliableWS {
@ReliabilityBuffer(retryCount=10,
retryDelay="10 seconds")
public void sayHello(String input) {
System.out.println("Hello from RM, " + input);
}
}
Search WWH ::




Custom Search