Java Reference
In-Depth Information
public static void accessViaNonSpringClient() {
try {
URL url = new URL(" http://localhost:7001/eInsureWeb/axis/ å
PolicyQuoteService");
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.invoke("calculatePolicyQuote", new Object[]{"ff",1,2.5,4});
} catch (MalformedURLException ex) {
throw new RuntimeException(ex);
}
}
Remoting with Burlap
Spring provides some alternative remoting strategies for exposing services over HTTP.
One such alternative is its support for the Burlap and Hessian remoting protocols from
Caucho. Hessian supports binary data exchange over HTTP. I will concentrate on Burlap,
which allows simple text and XML-based data transfer. It is just a matter of configuration
to export a Spring service for access through the Burlap protocol. To do that, I will need to
ensure that the dispatcher servlet handles Burlap remoting. This requires some alteration
in the web application configuration file, as shown in Listing 5-38.
Listing 5-38. web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns=" http://java.sun.com/xml/ns/j2ee"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>insurance</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
 
Search WWH ::




Custom Search