![]() |
Michael Gilfix Online |
Navigation |
High Performance Dynamic Client-Side Web Services in J2EEAs Web Service component models become more prominent (thanks to the push for Service-Oriented Architecture (SOA) style of design), more and more J2EE applications are starting to contain dynamic client-side Web Services that link together many SOA capabilities. Such applications make use of dynamic Web Services in that the endpoints for the Web Service are only known at runtime -perhaps as a result of user profile information or dynamic configuration. The most common and widely used way to perform Web Service client invocations is through the use of a stub, using the model described in JSR 109. An auxiliary tool, such as WSDL2JAVA, is used to read the WSDL description of the Web Service interface and generate Java code that can be used to call the Web Service. This code presents itself to the user in the form of a Stub, which is a piece of code whose interface hides the entry point into the Web Services runtime used to make the actual invocation. Typically, the stub contains operations and arguments that map between XSD schema types and Java types; the idea being to hide the details of the Web Service invocation infrastructure from the programmer. Note: some of this will be alleviated by the new JAX WS specification for Web Services, described in JSR 224. There are two things to be aware of regarding stubs and dynamic Web Services:
The solution to this problem lies in the use of a Java trick by using the The use of
public class ThreadLocalMyStub {
private static ThreadLocal cached = new ThreadLocal() {
protected Object initialValue() {
return new MyStub();
}
}
public static MyStub getInstance() {
return (MyStub)cached.get();
}
// ....
}
By Michael Gilfix at 2007-01-11 20:55 | Application Servers | Web Services | Michael Gilfix's blog | login or register to post comments
|
SearchRecent blog posts
|