TOTD #16: Optimizing Metro Stubs by locally packaging the WSDL

When Metro stubs are used to invoke a Web service endpoint, two invocations are made over the network - one for retrieving the WSDL and the other for sending the request message.

The second invocation is easy to explain because that's when the actual message is sent to the endpoint.

The first invocation to retrieve the WSDL is necessary because the generated stubs contain only the portable method signatures and annotations. All the binding specific information, such as quality-of-service policy assertions, are retrieved at the runtime. This approach was taken because of two reasons:

  • All the binding information cannot be captured in the generated stubs
  • Quality-of-service may change between the stub generation and actual invocation.

However if the WSDL is not expected to change then you can consider locally packaging the WSDL with the client. In this case the locally packaged WSDL, instead of accessing over the network, is used to retrieve the binding information.

Metro runtime is integrated in GlassFish and can also be installed on Tomcat. Vivek explained the several Tooling options with Metro - NetBeans IDE being the most comprehensive.

Several screencasts are available to get you started with Metro.

Please leave suggestions on other TOTD that you'd like to see. A complete archive is available here.

Technorati: webservices metro glassfish netbeans performance totd

Comments:

Post a Comment:
Comments are closed for this entry.
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today