Sunday Nov 25, 2007

TOTD #19: How to Add Metro Quality-of-Service to Contract-First Endpoint ?

This TOTD explains how to add Reliability and Security to a Contract-First Endpoint using NetBeans IDE.

In the Contract-First, the contract, i.e. the WSDL, is defined first as opposed to starting from Java. The Metro programming model starts with a Java Service Endpoint Interface (SEI) and uses Web Service Designer to specify Security, Reliability and Transactions support. This blog uses the WSDL bundled with the fromwsdl sample of Metro download and adds Quality-of-Service attributes to it.

Here are the steps to enable Reliable Messaging to Contract-First endpoint:

  1. In a new Web project, right-click and select "Web Service from WSDL..." as shown below:

  2. Specify the Web Service Name, package name and chose the location of the WSDL as shown below:



    The Web Service port name is chosen for you. Alternatively, you can click on "Browse..." button next to "Web Service Port:" and select the appropriate port.
  3. Click on "Finish" and the Web Services Designer is shown as shown below:

  4. Right-click on the Project and select on "Undeploy and Deploy" to deploy the project.
  5. Expand the "Web Services" tree, select the newly added Web service and right-click on "Test Web Service". The Tester page is shown in a browser with links to the packaged WSDL file and text boxes and buttons to invoke the Web service.
  6. In the Web Services Designer, select "Reliable Message Delivery".
  7. Right-click on the project, select "Clean" to clean all the generated files. Again right-click on the project and then select "Undeploy and Deploy" to deploy the project again.
  8. As in step 5 above, test the Web service. The packaged WSDL now contains the appropriate policy assertions and Reliable Message Delivery is enabled on the endpoint.

As described in screencast #ws7, Security can be added to a Contract-First endpoint using the steps listed above.

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

Technorati: totd glassfish webservices netbeans metro wsdl reliability contractfirst

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