WSITTutorial
WSITTutorial
Copyright © 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, États-
Unis. Tous droits réservés.
Droits du gouvernement américain, utlisateurs gouvernmentaux - logiciel commercial. Les utilisateurs
gouvernmentaux sont soumis au contrat de licence standard de Sun Microsystems, Inc., ainsi qu aux dis-
positions en vigueur de la FAR [ (Federal Acquisition Regulations) et des suppléments à celles-ci.
Cette distribution peut comprendre des composants développés pardes tierces parties.
Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Enterprise JavaBeans, Java Naming and
Directory Interface, EJB, JSP, J2EE, J2SE et le logo Java Coffee Cup sont des marques de fabrique ou des
marques déposées de Sun Microsystems, Inc. aux États-Unis et dans d’autres pays.
A moins qu’autrement autorisé, le code de logiciel en tous les matériaux techniques dans le présent (arti-
cles y compris, FAQs, échantillons) est fourni sous ce permis.
Les produits qui font l’objet de ce manuel d’entretien et les informations qu’il contient sont régis par la
législation américaine en matière de contrôle des exportations et peuvent être soumis au droit d’autres
pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour
des armes nucléaires, des missiles, des armes biologiques et chimiques ou du nucléaire maritime, directe-
ment ou indirectement, sont strictement interdites. Les exportations ou réexportations vers des pays sous
embargo des États-Unis, ou vers des entités figurant sur les listes d’exclusion d’exportation américaines,
y compris, mais de manière non exclusive, la liste de personnes qui font objet d’un ordre de ne pas partic-
iper, d’une façon directe ou indirecte, aux exportations des produits ou des services qui sont régi par la
législation américaine en matière de contrôle des exportations ("U .S. Commerce Department’s Table of
Denial Orders "et la liste de ressortissants spécifiquement désignés ("U.S. Treasury Department of Spe-
cially Designated Nationals and Blocked Persons "),, sont rigoureusement interdites.
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What is WSIT? 2
Bootstrapping and Configuration 3
Message Optimization Technology 4
Reliable Messaging Technology 5
Security Technology 6
How WSIT Relates to Windows Communication Foundation (WCF) 6
WSIT Specifications 7
Bootstrapping and Configuration Specifications 8
Message Optimization Specifications 10
Reliable Messaging Specifications 12
Security Specifications 13
How the WSIT Technologies Work 14
How Message Optimization Works 15
How Reliable Messaging Works 16
How Security Works 18
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
viii CONTENTS
About This Tutorial
THIS tutorial explains how to develop web applications using the Web Service
Interoperability Technologies (WSIT). The tutorial describes how, when, and
why to use the WSIT technologies and also describes the features and options
that each technology supports.
WSIT, developed by Sun Microsystems, implements several new web services
technologies including WS-Security, WS-Trust, WS-SecureConversation, WS-
ReliableMessaging, WS-AtomicTransactions, Data Binding, and Optimization.
WSIT was also tested in a joint effort by Sun Microsystems, Inc. and Microsoft
with the expressed goal of ensuring interoperability between web services appli-
cations developed using either WSIT and the Windows Communication Founda-
tion (WCF) product.
ix
x ABOUT THIS TUTORIAL
Required Software
To use this tutorial you must download and install the following software:
• The latest Java SE 5.0 (Update 12) or JDK 6.0 (Update 2) with which the
WSIT version 1.0 FCS software has been extensively tested
• GlassFish version 2 Build 58g, your web container
You can run the examples in this tutorial that use a web container without
the NetBeans IDE on either GlassFish or Tomcat. However, for this edi-
tion of the tutorial, you can only run the examples that use a web con-
tainer and the NetBeans IDE with GlassFish.
• WSIT distribution (version 1.0 FCS)
• Netbeans IDE 5.5.1 FCS
• WSIT plug-in modules, Version 2.41, for Netbeans IDE 5.5.1
See the WSIT Installation Instructions, located at https://wsit-
docs.dev.java.net/releases/1-0-FCS/install.html, for instructions about
downloading and installing all the required software.
ABOUT THIS TUTORIAL xi
To run the examples described in this tutorial, you must also download the WSIT
samples kits. Download the sample kits from the following locations:
• https://wsit.dev.java.net/source/browse/*check-
out*/wsit/wsit/docs/howto/wsit-enabled-fromjava.zip
• https://wsit.dev.java.net/source/browse/*check-
out*/wsit/wsit/docs/howto/wsit-enabled-fromwsdl.zip
• https://wsit.dev.java.net/source/browse/*check-
out*/wsit/wsit/docs/howto/csclient-enabled-fromjava.zip
• https://wsit-docs.dev.java.net/releases/1-0-FCS/wsittuto-
rial.zip
Typographical Conventions
Table 1 lists the typographical conventions used in this tutorial.
Feedback
Please send comments, broken link reports, errors, suggestions, and questions
about this tutorial to the tutorial team at [email protected].
xii ABOUT THIS TUTORIAL
1
Introduction
This tutorial describes how to use the Web Services Interoperability Technolo-
gies (WSIT)—a product of Sun Microsystems web services interoperability
effort to develop Java clients and service providers that interoperate with
Microsoft .NET 3.0 clients and service providers.
The tutorial consists of the following chapters:
• This chapter, the introduction, introduces WSIT, highlights the features of
each WSIT technology, describes the standards that WSIT implements for
each technology, and provides high-level descriptions of how each tech-
nology works.
• Chapter 2 provides instructions for creating, deploying, and testing Web
service providers and clients using NetBeans IDE.
• Chapter 3 describes how to create a WSIT client from a Web Service
Description Language (WSDL) file.
• Chapter 4 describes how to configure web service providers and clients to
use message optimization.
• Chapter 5 describes how to configure web service providers and clients to
use reliable messaging.
• Chapter 6 describes how to use the NetBeans IDE to configure web service
providers and clients to use web services security.
• Chapter 8 provides code examples and instructions for creating, deploying,
and testing web service providers and clients using either of the supported
web containers.
1
2 INTRODUCTION
What is WSIT?
Sun is working closely with Microsoft to ensure interoperability of web services
enterprise technologies such as message optimization, reliable messaging, and
security. The initial release of WSIT is a product of this joint effort. WSIT is an
implementation of a number of open web services specifications to support
enterprise features. In addition to message optimization, reliable messaging, and
security, WSIT includes a bootstrapping and configuration technology. Figure 1–
1 shows the underlying services that were implemented for each technology.
Starting with the core XML support currently built into the Java platform, WSIT
uses or extends existing features and adds new support for interoperable web ser-
vices. See the following sections for an overview of each feature:
• Bootstrapping and Configuration (page 3)
• Message Optimization Technology (page 4)
• Reliable Messaging Technology (page 5)
• Security Technology (page 6)
1. Client acquires the URL for a web service that it wants to access and con-
sume. How you acquire the URL is outside the scope of this tutorial. For
example, you might look up the URL in a Web Services registry.
2. The client uses the URL and the wsimport tool to send a MetadataExchan-
geRequest to access the web service and retrieve the WSDL file. The
WSDL file contains a description of the web service endpoint, including
WS-Policy assertions that describe the security and/or reliability capabili-
4 INTRODUCTION
ties and requirements of the service. The description describes the require-
ments that must be satisfied to access and consume the web service.
3. The client uses the WSDL file to create the web service client.
4. The web service client accesses and consumes the web service.
Chapter 3 explains how to bootstrap and configure a web service client and a
web service endpoint that use the WSIT technologies.
Security Technology
Until now, web services have relied on transport-based security such as SSL to
provide point-to-point security. WSIT implements WS-Security so as to provide
interoperable message content integrity and confidentiality, even when messages
pass through intermediary nodes before reaching their destination endpoint. WS-
Security as provided by WSIT is in addition to existing transport-level security,
which may still be used.
WSIT also enhances security by implementing WS-Secure Conversation, which
enables a consumer and provider to establish a shared security context when a
multiple-message-exchange sequence is first initiated. Subsequent messages use
derived session keys that increase the overall security while reducing the security
processing overhead for each message.
Further, WSIT implements two additional features to improve security in web
services:
• Web Services Security Policy—Enables web services to use security asser-
tions to clearly represent security preferences and requirements for web
service endpoints.
• Web Services Trust—Enables web service applications to use SOAP mes-
sages to request security tokens that can then be used to establish trusted
communications between a client and a web service.
WSIT implements these features in such a way as to ensure that web service
binding security requirements, as defined in the WSDL file, can interoperate
with and be consumed by WSIT and WCF endpoints.
For instructions on how to use the WS-Security technology, see Chapter 6.
Note: Because WSIT-based clients and services are interoperable, you can gain the
benefits of WSIT without using WCF.
WSIT Specifications
The specifications for bootstrapping and configuration, message optimization,
reliable messaging, and security technologies are discussed in the following sec-
tions:
• Bootstrapping and Configuration Specifications (page 8)
• Message Optimization Specifications (page 10)
• Reliable Messaging Specifications (page 12)
• Security Specifications (page 13)
WSIT 1.0 implements the following versions of these specifications:
• Bootstrapping
• WS-MetadataExchange v1.1
• Reliable Messaging
• WS-ReliableMessaging v1.0
8 INTRODUCTION
In addition to the Core XML specifications and supporting standards (Web Ser-
vices Security and Web Services Policy—which are required building blocks),
the reliability feature is implemented using the following specifications:
• Web Services Reliable Messaging: This specification defines a standardized
way to identify, track, and manage the reliable delivery of messages
between exactly two parties, a source and a destination, so as to recover
from failures caused by messages being lost or received out of order. The
specification is also extensible so it allows additional functionality, such as
security, to be tightly integrated. The implementation of this specification
integrates with and complements the Web Services Security, and the Web
Services Policy implementations.
• Web Services Coordination: This specification defines a framework for pro-
viding protocols that coordinate the actions of distributed applications.
This framework is used by Web Services Atomic Transactions. The imple-
mentation of this specification enables the following capabilities:
• Enables an application service to create the context needed to propagate
an activity to other services and to register for coordination protocols.
• Enables existing transaction processing, workflow, and other coordina-
tion systems to hide their proprietary protocols and to operate in a het-
erogeneous environment.
WSIT SPECIFICATIONS 13
• Defines the structure of context and the requirements so that context can
be propagated between cooperating services.
• Web Services Atomic Transactions: This specification defines a standard-
ized way to support two-phase commit semantics such that either all oper-
ations invoked within an atomic transaction succeed or are all rolled back.
Implementations of this specification require the implementation of the
Web Services Coordination specification.
Security Specifications
Figure 1–6 shows the specifications implemented to secure communication
between two web service endpoints and across intermediate endpoints.
Figure 1–7 shows a simplified view of client and web service application mes-
sage exchanges when the Reliable Messaging protocol is not used.
When the Reliable Messaging protocol is not used, application messages flow
over the HTTP connection with no delivery assurances. If messages are lost in
transit or delivered out of order, the communicating endpoints have no way of
knowing.
Figure 1–8 shows a simplified view of client and web service application mes-
sage exchanges when reliable messaging is enabled.
tion module allows the messages to proceed through the JAX-WS dispatch for
delivery to the endpoint or application destination.
The security policy model uses the policy specified in the WSDL file for associ-
ating policy assertions with web service communication. As a result, whenever
possible, the security policy assertions do not use parameters or attributes. This
enables first-level, QName-based assertion matching to be done at the frame-
work level without security domain-specific knowledge. The first-level matching
provides a narrowed set of policy alternatives that are shared by the client and
web service endpoint when they attempt to establish a secure communication
path.
To establish trust between a client, a Security Token Service, and a web service:
1. The client establishes an HTTPS connection with the Secure Token Ser-
vice using one of the following methods:
• Username Authentication and Transport Security: The client authenti-
cates to the Security Token Service using a username token. The Secu-
rity Token Service uses a certificate to authenticate to the Client.
Transport security is used for message protection.
• Mutual Authentication: Both the client-side and server-side use X509
certificates to authenticate to each other. The client request is signed
using Client’s X509 certificate, then signed using ephemeral key. The
web service signs the response using keys derived from the client’s key.
2. The client sends a RequestSecurityToken message to the Security Token
Service.
3. The Security Token Service sends a Security Assertion Markup Language
(SAML) token to the Client.
4. The client uses the SAML token to authenticate itself to the web service
and trust is established.
All communication uses SOAP messages.
HOW THE WSIT TECHNOLOGIES WORK 21
THIS chapter describes how to use NetBeans IDE and GlassFish to build and
deploy a web service and client that use WSIT technologies. It includes exam-
ples of the files that the IDE helps you create and examples of the build directo-
ries and the key files that the IDE produces to create a web service and a client.
This chapter covers the following topics:
• Registering GlassFish with the IDE (page 23)
• Creating a Web Service (page 24)
• Configuring WSIT Features in the Web Service (page 26)
• Deploying and Testing a Web Service (page 28)
• Creating a Client to Consume a WSIT-Enabled Web Service (page 29)
23
24 WSIT EXAMPLE USING A WEB CONTAINER AND NETBEANS
1. Start the IDE and choose Tools→Server Manager from the main window.
The Server Manager window appears.
2. Click Add Server. Select the Sun Java System Application Server, assign a
name to server instance, and click Next. The platform folder location win-
dow appears.
3. Specify the platform location of the server instance, and the domain to
which you want to register, and click Finish. The Server Manager window
appears.
4. Enter the server username and password that you supplied when you
installer the web container (the default is admin/adminadmin) and click
Close.
package org.me.calculator;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@WebService()
public class Calculator {
@WebMethod(action="sample_operation")
public String operation(@WebParam(name="param_name")
String param) {
// implement the web service operation here
return param;
}
@WebMethod(action=”add”)
public int add(@WebParam(name = "i") int i,
@WebParam(name = "j") int j) {
int k = i + j;
return k;
}
}
CREATING A WEB SERVICE 25
Notice that this web service performs a very simple operation. It takes two inte-
gers, adds them, and returns the result.
Perform the following steps to use the IDE to create this web service:
1. Click on the Runtime tab in the left pane and verify that GlassFish is listed
in the left pane. If it is not listed, refer to Registering GlassFish with the
IDE (page 23) and register it.
2. Choose File→New Project, select Web Application from the Web cate-
gory, and click Next.
3. Assign the project a name that is representative of services that will be pro-
vided by the web service (for example, CalculatorApplication), set the
Project Location to the location of the Sun application server, and click
Finish.
Note: As of this writing, when creating the web service project be sure to define a
Project Location that does not include spaces in the directory name. Spaces in the
directory might cause the web service and web service clients to fail to build and
deploy properly. To avoid this problem, Sun recommends that you create a direc-
tory, for example C:\work, and put your project there.
8. Right-click within the body of the class and choose Web Service→Add
Operation.
9. In the upper part of the Add Operation dialog box, type add in Name and
choose int from the Return Type drop-down list.
10. In the lower part of the Add Operation dialog box, click Add and create a
parameter of type int named i. Click OK. Click Add again and create a
parameter of type int called j. Click OK and close the Enter Method
Parameter dialog box.
26 WSIT EXAMPLE USING A WEB CONTAINER AND NETBEANS
This setting ensures that the service sends an acknowledgement to the cli-
ents for each message that is delivered, thus enabling clients to recognize
message delivery failures and to retransmit the message. This capability
makes the web service a “reliable” web service.
3. In the left pane, expand the Web Pages node and the WEB-INF node, and
open the wsit-<endpoint classname>.xml file in the Source Editor.
Notice that the IDE has added the following tags to the file to enable reli-
able messaging:
<wsp:Policy wsu:Id="CalculatorWSPortBindingPolicy">
<wsp:ExactlyOne>
28 WSIT EXAMPLE USING A WEB CONTAINER AND NETBEANS
<wsp:All>
<wsaw:UsingAddressing xmlns:wsaws=
"http://www.w3.org/2006/05/addressing/wsdl"/>
<wsrm:RMAssertion/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
You have now successfully tested the deployment of a WSIT-enabled web ser-
vice.
CREATING A CLIENT TO CONSUME A WSIT-ENABLED WEB SERVICE 29
Note: NetBeans submenus are dynamic, so the Web Service Client option may not
appear. If you do not see the Web Service Client option, select New→−
File\Folder→Webservices→Web Service Client.
Then add the line in bold at the end of the try block, as shown below.
try { // Call Web Service Operation
org.me.calculator.client.CalculatorWS port =
service.getCalculatorWSPort();
// TODO initialize WS operation arguments here
int i = 3;
int j = 4;
// TODO initialize WS operation arguments here
int i = 3;
int j = 4;
// TODO process result here
int result = port.add(i, j);
32 WSIT EXAMPLE USING A WEB CONTAINER AND NETBEANS
THIS chapter explains how to retrieve information that is used to access and
consume a WSIT-enabled web service and provides pointers to examples that
demonstrate how to bootstrap and configure WSIT-enabled clients from Web
Services Description Language (WSDL) files.
The following topics are covered in this chapter:
• What is a Server-Side Endpoint? (page 33)
• Creating a Client from WSDL (page 34)
• Client From WSDL Examples (page 35)
33
34 BOOTSTRAPPING AND CONFIGURATION
description to generate code that can send SOAP messages to and receive SOAP
messages from the web service endpoint.
37
38 MESSAGE OPTIMIZATION
This setting configures the web service to optimize messages that it trans-
mits and to decode optimized messages that it receives.
16. Change the value for int i and int j to other numbers, such as 3 and 4.
17. Change the System.out.println statement to out.println.
18. Add a line that prints out an exception, if an exception is thrown. The try/
catch block should look as follows (new and changed lines are highlighted
in bold text):
try { // Call Web Service Operation
org.me.calculator.client.CalculatorWS port =
service.getCalculatorWSPort();
// TODO initialize WS operation arguments here
int i = 3;
int j = 4;
// TODO process result here
int result = port.add(i, j);
42 MESSAGE OPTIMIZATION
THIS chapter explains how to configure reliable messaging in web service pro-
viders and clients.
This chapter covers the following topics:
• Reliable Messaging Options (page 43)
• Creating Web Service Providers and Clients that use Reliable Messaging
(page 45)
• Using Secure Conversation With Reliable Messaging (page 45)
Option Description
43
44 USING RELIABLE MESSAGING
Option Description
47
48 USING WSIT SECURITY
5. Select Secure Service. This option enables WSIT security for all of the
operations of a web service.
For information on how to secure selected operations, refer to Securing an
Operation (page 86).
6. Select a Security Mechanism from the list.
Most of the mechanisms are fully functional without further configura-
tion, however, if you’d like to customize the mechanism, click Configure
to specify the configuration for that mechanism.
50 USING WSIT SECURITY
Figure 6–2 Web Service References Attributes Editor Page for Web Service Clients
6. Refer to Table 6–2 for a summary of what options are required on the client
side. The configuration requirements for the client are dependent upon
which security mechanism is specified on the server side.
7. Click OK to save your changes.
The WSIT configuration information is saved in two files under Source
Packages→META-INF.
To view the WSIT configuration files, in the tree, drill down from the project to
Source Packages→META-INF. Double-click on <service>Service.xml or
wsit-client.xml to view the contents. The full contents of example client
WSIT configuration files can be viewed at Client-Side WSIT Configuration Files
(page 130).
Summary of Configuration
Requirements
The following sections summarize the options that need to be configured for
each of the security mechanisms on both the service and client side. The config-
uration requirements for the client are dependent upon which security mecha-
nism is specified on the server side.
SUMMARY OF SERVICE-SIDE CONFIGURATION REQUIREMENTS 53
User in
Mechanism Keystore Truststore STS SSL GlassFish
Username Auth.
w/Symmetric YES YES
Keys
YES
Mutual Certs. YES
(no alias)
Message Auth.
over SSL - User- YES YES
name Token
Message Auth.
YES
over SSL - X.509 YES
(no alias)
Token
SAML Sender
YES
Vouches with YES
(no alias)
Cert.
STS Issued
YES YES YES
Token
STS Issued
Token with Ser- YES YES YES
vice Cert.
STS Issued
YES YES YES
Endorsing Token
SUMMARY OF CLIENT-SIDE CONFIGURATION REQUIREMENTS 55
• Keystore—If this column indicates YES, click the Keystore button and
configure the keystore to specify the alias identifying the service certificate
and private key. For the GlassFish keystores, the file is keystore.jks and
the alias is xws-security-server, assuming that you’ve updated the
GlassFish default certificate stores as described in Updating GlassFish
Certificates (page 75).
• Truststore—If this column indicates YES, click the Truststore button and
configure the truststore to specify the alias that contains the certificate and
trusted roots of the client. For the GlassFish keystores, the file is cac-
erts.jks and the alias is xws-security-client, assuming that you’ve
updated the GlassFish default certificate stores as described in Updating
GlassFish Certificates (page 75).
• STS—If this column indicates YES, you must have a Security Token Ser-
vice that can be referenced by the service. An example of an STS can be
found in the section Creating and Securing the STS (STS) (page 118). The
STS is secured using a separate (non-STS) security mechanism. The secu-
rity configuration for the client-side of this application is dependent upon
the security mechanism selected for the STS, and not on the security mech-
anism selected for the application.
• SSL—To use a mechanism that uses secure transport (SSL), you must con-
figure the system to point to the client and server keystore and truststore
files. Steps for doing this are described in Configuring SSL For Your
Applications (page 70).
• User in Glassfish—To use a mechanism that requires a user database for
authentication, you can add a user to the file realm of GlassFish. Instruc-
tions for doing this can be found at Adding Users to GlassFish (page 73).
SAML User
Key Trust Default Callback in
Mechanism store store User Handler STS SSL GF
Username
Auth. w/Sym- YES YES YES
metric Keys
Message
Auth. over
YES YES YES
SSL - User-
name Token
Message
Auth. over
YES YES
SSL - X.509
Token
SAML Auth.
YES YES YES YES
over SSL
Endorsing
YES YES
Cert.
SAML Sender
Vouches with YES YES YES
Cert.
SAML Holder
YES YES YES
of Key
STS Issued
YES YES Y
Token
STS Issued
Token with YES YES Y
Service Cert.
SUMMARY OF CLIENT-SIDE CONFIGURATION REQUIREMENTS 57
SAML User
Key Trust Default Callback in
Mechanism store store User Handler STS SSL GF
STS Issued
Endorsing YES YES Y
Token
the security mechanism selected for the STS, and not on the security mech-
anism selected for the application.
• SSL—To use a mechanism that uses secure transport (SSL), you must con-
figure the system to point to the client and server keystore and truststore
files. Steps for doing this are described in Configuring SSL For Your
Applications (page 70).
• User in Glassfish—To use a mechanism that requires a user database for
authentication, you can add a user to the file realm of GlassFish. Instruc-
tions for doing this can be found at Adding Users to GlassFish (page 73).
/*
Set confirmation Method to SV [SenderVouches] or
HOK[Holder of Key]
*/
samlCallback.setConfirmationMethod
(samlCallback.SV_ASSERTION_TYPE);
if(samlCallback.getConfirmationMethod().equals(
samlCallback.SV_ASSERTION_TYPE)) {
samlCallback.setAssertionElement
(createSVSAMLAssertion());
svAssertion_saml10 =
samlCallback.getAssertionElement();
SUMMARY OF CLIENT-SIDE CONFIGURATION REQUIREMENTS 61
/*
samlCallback.setAssertionElement
(createSVSAMLAssertion20());
svAssertion_saml20 =
samlCallback.getAssertionElement();
*/
}else
if(samlCallback.getConfirmationMethod().equals(
samlCallback.HOK_ASSERTION_TYPE)) {
samlCallback.setAssertionElement
(createHOKSAMLAssertion());
hokAssertion_saml10 =
samlCallback.getAssertionElement();
/*
samlCallback.setAssertionElement
(createHOKSAMLAssertion20());
hokAssertion_saml20 =
samlCallback.getAssertionElement();
*/
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
throw unsupportedCallback;
}
62 USING WSIT SECURITY
Security Mechanisms
The following lists the possible choices for security mechanisms. These mecha-
nisms are discussed in the following sections:
• Username Authentication with Symmetric Keys (page 62)
• Mutual Certificates Security (page 63)
• Transport Security (SSL) (page 63)
• Message Authentication over SSL (page 65)
• SAML Authorization over SSL (page 65)
• Endorsing Certificate (page 66)
• SAML Sender Vouches with Certificates (page 66)
• SAML Holder of Key (page 67)
• STS Issued Token (page 67)
• STS Issued Token with Service Certificate (page 68)
• STS Issued Endorsing Token (page 68)
A table that summarizes the configuration options on the server side is available
in Summary of Service-Side Configuration Requirements (page 53).
Some common communication issues that need to be addressed using security
mechanisms are discussed in Issues Addressed Using Security Mechanisms
(page 123).
Note: If you use the fully-qualified hostname (FQHN) in the URL for the service
WSDL when you are adding the web service client to the client application, this
workaround is not required. It is only required when you specify localhost in the
URL for the service WSDL.
The recommended way to overcome this issue is to generate the server certificate
with the Common Name (CN) matching the host name.
To workaround this only during development, in your client code, you can set the
default host name verifier to a custom host name verifier which does a custom
check. An example is given below. It is sometimes necessary to include this in
the static block of your main Java class as shown below to set this verifier before
any connections are made to the server.
static {
//WORKAROUND. TO BE REMOVED.
MESSAGE AUTHENTICATION OVER SSL 65
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(
new javax.net.ssl.HostnameVerifier(){
Please remember to remove this once you install valid certificates on the server.
Endorsing Certificate
This mechanism uses secure messages using symmetric key for integrity and
confidentiality protection, and uses an endorsing client certificate to augment the
claims provided by the token associated with the message signature. For this
mechanism, the client knows the service’s certificate, and requests need to be
endorsed/authorized by a special identity. For example, all requests to a vendor
must be endorsed by a purchase manager, so the certificate of the purchase man-
ager should be used to endorse (or counter sign) the original request.
For this mechanism, the SAML token is included as part of the message signa-
ture as an authorization token and is sent only to the recipient. The message pay-
load needs to be signed and encrypted. The requestor is vouching for the
credentials (present in the SAML assertion) of the entity on behalf of which the
requestor is acting.
The initiator token, which is an X.509 token, is used for signature. The recipient
token, which is also an X.509 token, is used for encryption. For the server, this is
reversed, the recipient token is the signature token and the initiator token is the
encryption token. A SAML token is used for authorization.
See Also: Example: SAML Sender Vouches with Certificates (SV) (page 112).
SAML HOLDER OF KEY 67
Under this scenario, the service does not trust the client directly, but requires the
client to send a SAML assertion issued by a particular SAML authority. The cli-
ent knows the recipient’s public key, but does not share a direct trust relationship
with the recipient. The recipient has a trust relationship with the authority that
issues the SAML token. The request is signed with the client’s private key and
encrypted with the server certificate. The response is signed using the server’s
private key and encrypted using the key provided within the HOK SAML asser-
tion.
• To use a mechanism that uses secure transport (SSL), you must configure
the system to point to the client and server keystore and truststore files.
Steps for doing this are described in Configuring SSL For Your Applica-
tions (page 70).
to point to the client stores, as both GlassFish and NetBeans are aware of
these certificates and point to them by default.
In general, for the client side of SSL you will not be using the same certif-
icates for the client and the service. In that case, you need to define the
client certificate stores by setting the system properties -
Djavax.net.ssl.trustStore, -Djavax.net.ssl.keyStore, -
Djavax.net.ssl.trustStorePassword, and
-Djavax.net.ssl.keyStorePassword in the application client con-
tainer.
You can specify the environment variables for keystore and truststore by
setting the environment variable VMARGS through the shell environment or
inside an Ant script, or by passing them in when you start NetBeans IDE
from the command line. For example, in the latter case:
<NETBEANS_HOME>/bin/netbeans.exe
-J-Djavax.net.ssl.trustStore=
<AS_HOME>/domains/domain1/config/cacerts.jks
-J-Djavax.net.ssl.keyStore=
<AS_HOME>/domains/domain1/config/keystore.jks
-J-Djavax.net.ssl.trustStorePassword=changeit
-J-Djavax.net.ssl.keyStorePassword=changeit
Use the hard-coded path to the keystore and truststore files, not variables.
For the SSL mechanism, The browser will prompt you to accept the
server alias s1as.
4. On the client side, for the Transport Security (SSL) mechanism, you must
either use the fully-qualified hostname in the URL for the service WSDL
when you are creating the web sercie client, or else you must follow the
steps in Transport Security (SSL) Workaround (page 64).
5. Service Configuration
To require the service to use the HTTPS protocol, you have to specify the
security requirements in the service’s application deployment descriptor.
This file is ejb-jar.xml for a web service that is implemented as an EJB
endpoint, and web.xml for a web service implemented as a servlet. To
specify the security information, follow these steps:
a. From your web service application expand Web Pages→WEB-INF.
b. Double-click web.xml (or ejb-jar.xml) to open it in the editor.
c. Select the Security tab.
d. On the Security Constraints line, click Add Security Constraint.
72 USING WSIT SECURITY
i. Click the XML tab to display the additions to web.xml. The security
constraint looks like this:
<security-constraint>
<display-name>Constraint1</display-name>
<web-resource-collection>
<web-resource-name>
CalcWebResource
</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
<http-method>POST</http-method>
ADDING USERS TO GLASSFISH 73
</web-resource-collection>
<user-data-constraint>
<description/>
<transport-guarantee>
CONFIDENTIAL
</transport-guarantee>
</user-data-constraint>
</security-constraint>
j. When you run this project (right-click, select Run Project), the browser
will ask you to accept the server certificate of s1as. Accept this certifi-
cate. The WSDL displays in the browser.
6. Creating a Client
When creating your client application, use the fully-qualified hostname to
specify the secure WSDL location (use https://
<fully_qualified_hostname>:8181/CalculatorApplication/Cal-
culatorWSService?wsdl, for example, in place of http://local-
host:8080/CalculatorApplication/CalculatorWSService?wsdl).
In some cases, you might get an error dialog telling you that the URL
https://<fully_qualified_hostname>:8181/CalculatorApplica-
tion/CalculatorWSService?wsdl couldn't be downloaded. However,
this is the correct URL, and it does load when you run the service. So,
when this error occurs, repeat the steps that create the Web Service Client
using the secure WSDL. The second time, the web service reference is
created and you can continue creating the client.
2. Start the Admin Console if you haven’t already done so. You can start the
Admin Console by starting a web browser and entering the URL http://
localhost:4848/asadmin. If you changed the default Admin port during
installation, enter the correct port number in place of 4848.
3. To log in to the Admin Console, enter the user name and password of a user
in the admin-realm who belongs to the asadmin group. The name and
password entered during installation will work, as will any users added to
this realm and group subsequent to installation.
4. Expand the Configuration node in the Admin Console tree.
5. Expand the Security node in the Admin Console tree.
6. Expand the Realms node. Select the file realm.
7. Click the Manage Users button.
8. Click New to add a new user to the realm.
9. Enter the correct information into the User ID, Password, and Group(s)
fields. The example applications reference a user with the following
attributes:
a. User ID = wsitUser
b. Group List = wsit
c. New Password = changeit
d. Confirm New Password = changeit
10.Click OK to add this user to the list of users in the realm.
11.Click Logout when you have completed this task.
The following sections discuss how to specify and configure the keystore, trust-
store, and validators.
If the certificates were not successfully update, your response will look
something like this:
keytool error: java.lang.Exception: Alias <wssip> does not
exist
c. Verify that the v3 certificate has been imported into the GlassFish key-
store. To do this, run the following keytool command:
SPECIFYING ALIASES WITH THE UPDATED STORES 77
Client-Side
xws-security-client xws-security-server
Configuration
Server-Side
xws-security-server xws-security-client
Configuration
78 USING WSIT SECURITY
The configuration of the aliases for applications that use a Security Token Ser-
vice (STS) mechanism is as shown in Table 6–4:
Client-Side
xws-security-client xws-security-server
Configuration
STS
xws-security-client wssip
Configuration
6. Depending on what is required for the selected mechanism, you may spec-
ify the following information in the Keystore Configuration dialog:
• Location—Use the Browse button to specify the location and name of
the keystore. By default, this field specifies the GlassFish keystore file,
<AS_HOME>/domains/domain1/config/keystore.jks.
• Keystore Password—Specifies the password for the keystore file. If
you are running under GlassFish, GlassFish’s password is already
entered. If you have changed the keystore’s password from the default,
you must specify the correct value in this field.
• Load Aliases—Click the Load Aliases button to populate the Alias field
with the aliases contained in the keystore file. The Location and Store
Password fields must be specified correctly for this option to work.
• Alias—Specifies the alias of the certificate in the specified keystore to
be used for authentication. Refer to the table in Specifying Aliases with
the Updated Stores (page 77) to determine which alias to choose for the
selected security mechanism.
• Key Password—Specifies the password of the key within the keystore.
For this sample, leave this blank. For this field, the default assumes the
key password is the same as the store password, so you only need to
specify this field when the key password is different.
NOTE: The Key Password field enables you to specify a password for the
keystore used by the application. When specified, this password is stored
in a WSIT configuration file in clear text, which is a security risk. Setting
the keystore password in the development environment is fine, however,
when you go into production, remember to use the container’s Callback
Handler to obtain the keys from the keystore. This eliminates the need for
80 USING WSIT SECURITY
the keystore passwords to be supplied by the users. You can also specify
the passwords for keystores and truststores by specifying a Callback Han-
dler class that implements the javax.security.auth.callback.Call-
backHandler interface in the Key Password or Store Password fields.
NOTE: The Store Password field enables you to specify a password for
the truststore used by the application. When specified, this password is
stored in a WSIT configuration file in clear text, which is a security risk.
Setting the truststore password in the development environment is fine,
however, when you go into production, remember to use the container’s
Callback Handler to obtain the keys from the truststore. This eliminates
the need for the truststore passwords to be supplied by the users. You
can also specify the passwords for keystores and truststores by specify-
ing a CallbackHandler class that implements the javax.secu-
rity.auth.callback.CallbackHandler interface in the Key
Password or Store Password fields.
• Load Aliases—Click the Load Aliases button to populate the Alias field
with the aliases contained in the truststore file. The Location and Store
Password fields must be specified correctly for this option to work.
• Alias—Specifies the peer alias of the certificate in the truststore that is
to be used when the client needs to send encrypted data. Refer to the
table in Specifying Aliases with the Updated Stores (page 77) to deter-
mine which alias is appropriate for the selected security mechanism.
supplied by the users. You can also specify the passwords for keystores
and truststores by specifying a CallbackHandler class that implements
the javax.security.auth.callback.CallbackHandler interface in
the Keystore Password, Truststore Password, or Key Password fields.
• Load Aliases—Click this button to populate the Alias list with all of the
certificates available in the selected keystore. This option will only work
if the truststore location and password are correct.
• Truststore Alias—Select the alias of the server certificate and private key
in the client truststore. Refer to the table in Specifying Aliases with the
Updated Stores (page 77) to determine which alias is appropriate for the
selected security mechanism.
8. When the certificates are configured as suggested for some of the examples
in this chapter, the dialog will look like this:
Configuring Validators
A validator is an optional set of classes used to check the validity of a token, a
certificate, a timestamp, or a username and password.
Applications that run under a GlassFish 9.1 container do not need to configure
Callback Handlers and Validators when using the IDE with WSIT enabled. This
is because the container handles the callbacks and validation. You only need to
make sure that the certificates are available at locations that GlassFish requires
and/or create authorized users using the Admin Console (described in Adding
Users to GlassFish (page 73).
Validators are always optional because there are defaults in the runtime (regard-
less of the container and regardless of whether the application is a JSR-109 or a
non-JSR-109 deployment.) For non-JSR-109 deployment, you only need to
specify a validator when you want to override the default validators. For JSR-
109 deployments, there is no point in specifying an overriding validator, as these
will be overridden back to the defaults by GlassFish, thus the Validators button is
not available when the selected web service is a JSR-109-compliant application.
To set the validator configuration options for a non-JSR-109-compliant applica-
tion (such as a J2SE client), perform the following steps:
1. Right-click the web service and select Edit Web Service Attributes. The
Web Service Attributes editor is displayed.
2. Enable Secure Service.
3. Click the Validator button.
4. On the Validator Configuration page, specify the following options, when
necessary:
• Username Validator—Specifies the validator class to be used to vali-
date username and password on the server side. This option is only used
by a web service.
NOTE: When using the default Username Validator, make sure that the
username and password of the client are registered with GlassFish
(using Admin Console, described in Adding Users to GlassFish,
page 73) if using GlassFish, or is included in the tomcat-users.xml
file if using Tomcat.
• Timestamp Validator—Specifies the validator class to be used to
check the token timestamp to determine whether the token has expired
or is still valid.
86 USING WSIT SECURITY
Securing an Operation
This section discusses specifying security mechanisms at the level of a web ser-
vice operation.
The <operation_name>Operation section consists of three subsections. These
include:
• Operation
At times, you may need to configure different operations with different
supporting tokens. You may wish to configure security at the operation
level, for example, in the situation where only one operation requires a
UsernameToken to be passed and the rest of the operations do not require
this, or in the situation where only one operation needs to be endorsed by
a special token and the others do not.
• Input Message and Output Message
Security mechanisms at this level are used to specify what is being pro-
tected and the level of protection required.
In this section, you can specify parts of a message that require integrity
protection (digital signature) and/or confidentiality (encryption). When
you do this, the specified part of the message, outside of security headers,
requires signature and/or encryption. For example, a message producer
might submit an order that contains an orderID header. The producer
signs and/or encrypts the orderID header (the SOAP message header)
and the body of the request (the SOAP message body). Parts that can be
signed and/or encrypted include the body, the header, the local name of
the SOAP header, and the namespace of the SOAP header.
You can also specify arbitrary elements in the message that require integ-
rity protection and/or confidentiality. Because of the mutability of some
SOAP headers, a message producer may decide not to sign and/or encrypt
the SOAP message header or body as a whole, but instead sign and/or
encrypt elements within the header and body. Elements that can be signed
SPECIFYING SECURITY AT THE OPERATION, INPUT MESSAGE, OR OUTPUT MESSAGE LEVEL 87
6. Expand the Operation section. The section will be grayed out if Secure
Service is not selected.
7. Specify the following option, as appropriate:
• Transactions—Select an option from the Transactions list to specify a
level at which transactions will be secured. For this release, transactions
will only use SSL for security. Transactions are discussed in Chapter 11,
Using Atomic Transactions.
8. Expand the Input Message section. This section will be grayed out if
Secure Service is not selected.
9. Specify the following options, as appropriate:
• Authentication Token— Specifies which supporting token will be used
to sign and/or encrypt the specified message parts. Options include
Username, X509, SAML, Issued, or None. For further description of
these options, read Supporting Token Options (page 90).
SPECIFYING SECURITY AT THE OPERATION, INPUT MESSAGE, OR OUTPUT MESSAGE LEVEL 89
11.Click in a checkbox to the right of the message part or element that you
would like to sign, encrypt or require.
• Select Sign to specify the parts or elements of a message that require
integrity protection (digital signature).
• Select Encrypt to specify the parts or elements of a message that require
confidentiality (encryption).
• Select Require to specify the set of parts and/or elements that a message
must contain.
90 USING WSIT SECURITY
12.Click Add Body to add a row for the message body. This will only be nec-
essary if the row has been removed.
13.Click Add Header to add a row for either a specific SOAP header part or
for all SOAP header parts. This will only be necessary if the SOAP header
row in question has been deleted. The header parts that are available to sign
and/or encrypt before clicking the Add Header button include To
(Addressing), From (Addressing), FaultTo (Addressing), ReplyTo
(Addressing), MessageID (Addressing), RelatesTo (Addressing), and
Action (Addressing). After clicking Add Header, and then clicking All
Headers, you may also specify AckRequested (RM), SequenceAcknowl-
edgement (RM), and Sequence (RM).
14.There are no XPath elements displayed by default. Click Add XPath to add
rows that enable you to specify signature and/or encryption for an XPath
expression or a URI which indicates the version of XPath to use. By
default, the Required field is selected. This is an editable field. Double
click on the XPath row to specify the XPath expression or URI. Only one
XPath element is allowed.
NOTE: There is a limitation when specifying XPath elements. To use
XPath elements, switch off Optimize Security manually by adding the
disableStreamingSecurity policy assertion. For information on how to
do this, refer to http://blogs.sun.com/venu/ for more information on
disableStreamingSecurity.
15.To remove an element, select it in the Message Part section, and then click
Remove to remove it from message security.
16.Click OK to save these settings.
• X.509 Certificate
An X.509 certificate specifies a binding between a public key and a set of
attributes that includes (at least) a subject name, issuer name, serial num-
ber, and validity interval. An X.509 certificate may be used to validate a
public key that may be used to authenticate a SOAP message or to iden-
tify the public key with a SOAP message that has been encrypted. When
this option is selected, you must specify a truststore. For information on
specifying a truststore, read Configuring the Truststore on a Service
(page 80).
• Issued Token
An issued token is a token issued by a trusted Secure Token Service
(STS). The service does not trust the client directly, but instead trusts
tokens issued by a designated STS. In other words, the STS is taking on
the role of a second service with which the client has to securely authenti-
cate. The issued tokens contain a key, which is encrypted for the server
and which is used for deriving new keys for signing and encrypting.
• SAML Token
A SAML Token uses Security Assertion Markup Language (SAML)
assertions as security tokens.
When the web service being referenced by the client uses any of the STS secu-
rity mechanisms (refer to table in Summary of Service-Side Configuration
Requirements (page 53), an STS must be specified. You can specify the STS in
one of these ways.
• On the service side, specify the endpoint of the Issuer element and/or spec-
ify the Issuer Metadata Exchange (Mex) address of the STS.
If you need to create a third-party STS, follow the steps in Creating a
Third-Party STS (page 92).
If you already have an STS that you want to use, follow the steps in Spec-
ifying an STS on the Service Side (page 95).
An example that creates and uses an STS can be found in Example: STS
Issued Token (STS) (page 116).
• On the client side, specify the information for a preconfigured STS. This
is mainly used for a local STS that is in the same domain as the client. Con-
figuring the STS for the client is described in Specifying an STS on the Cli-
ent Side (page 95).
16.Select Act as Secure Token Service (STS). The default values will create
a valid STS. Optionally, you can change the following configuration
options:
• Issuer—Specify an identifier for the issuer for the issued token. This
value can be any string that uniquely identifies the STS, for example,
MySTS.
• Contract Implementation Class—Specify the actual implementation
class for the WSTrustContract interface that will handle token issu-
ance, validation, etc. Default value is
com.sun.xml.ws.trust.impl.IssueSamlTokenContractImpl for
issuing SAML assertions, or click Browse to browse to another contract
implementation class.
94 USING WSIT SECURITY
• Life Time of Issued Tokens—The life span of the token issued by the
STS. Default value is 300,000 ms.
• Encrypt Issued Key—Select this option if the issued key should be
encrypted using the service certificate. Default is true.
• Encrypt Issued Token—Select this option if the issued token should be
encrypted using the service certificate. Default is false.
17.Optionally, to add one or more Service Providers that have a trust relation-
ship with the STS, click the Add button and specify the following config-
uration options:
• Provider Endpoint URI—The endpoint URI of the service provider.
• Certificate Alias—The alias of the certificate of the service provider in
the keystore.
• Token Type—The type of token the service provider requires, for
example, urn:oasis:names:tc:SAML1.0:assertion.
• Key Type—The type of key the service provider requires. The choices
are public key or symmetric key. Symmetric key cryptography relies on
a shared secret and is usually faster than public key cryptography. Pub-
lic key cryptography relies on a key that is made public to all and is pri-
marily used for encryption but can be used for verifying signatures.
18.Click OK to close the Select STS Service Provider dialog.
19.Click OK to close the STS Configuration dialog.
20.Click the Keystore button to configure the keystore. If you are using the
updated GlassFish stores, these are the settings:
• Location—Defaults to the location and name of the keystore,
<AS_HOME>/domains/domain1/config/keystore.jks.
• Store Password—Enter or accept changeit.
• Load Aliases—Click the Load Aliases button.
• Alias—Select wssip.
• Click OK to close the dialog.
21.Right-click the STS Project, select Properties. Select the Run category,
and enter the following in the Relative URL field: /
<your_STS>Service?wsdl.
22.Run the Project (right-click the Project and select Run Project).
23.To view the STS WSDL, append <your_STS>Service to the URL of the
deployed application in the browser. For the example application (Exam-
ple: STS Issued Token (STS), page 116), you would view the STS WSDL
SPECIFYING AN STS ON THE SERVICE SIDE 95
by browsing to
http://localhost:8080//MySTSProject/MySTSService?wsdl.
7. Set the Algorithm Suite value so that the algorithm suite value of the ser-
vice matches the algorithm suite value of the STS.
Security_Federation_SecurityTokenService_Indigo/
Symmetric.svc/
Scenario_5_IssuedTokenForCertificate_MutualCertificate11
• WSDL Location:
http://131.107.72.15//
Security_Federation_SecurityTokenService_Indigo/
Symmetric.svc?wsdl
• Service Name:
MySTSService
• Port Name:
CustomBinding_IMySTSService
• Namespace:
http://tempuri.org/
Example Applications
The following example applications demonstrate configuring web services and
web service clients for different security mechanisms. If you are going to work
through the examples sequentially, you must manually undo the changes to the
service and then refresh the client in order for the client to receive the most
recent version of the service’s WSDL file, which contains the latest security con-
figuration information.
• Example: Username Authentication with Symmetric Keys (UA) (page 98)
• Example: Mutual Certificates Security (MCS) (page 101)
• Example: Transport Security (SSL) (page 104)
• Example: SAML Authorization over SSL (SA) (page 107)
• Example: SAML Sender Vouches with Certificates (SV) (page 112)
• Example: STS Issued Token (STS) (page 116)
An example of this file can be viewed in the tutorial by clicking this link:
Service-Side WSIT Configuration Files (page 125).
9. Right-click the CalculatorApplication node and select Run Project. A
browser will open and display the WSDL file for the application.
10.Verify that the WSDL file contains the following elements: Symmet-
ricBinding and UsernameToken.
11.Follow the steps to secure the client application as described in the next
section.
steps in the section Adding Users to GlassFish (page 73), the user name
is wsitUser and the password is changeit.
NOTE: In a production environment, you should configure a Username
Handler and a Password Handler class to eliminate the security risk asso-
ciated with the default username and password options.
7. Provide the server’s certificate by pointing to an alias in the client trust-
store. To do this, select the Certificates node, click the Load Aliases button
for the Truststore, and select xws-security-server from the Truststore
Alias list.
8. Click OK to close this dialog.
9. In the tree, drill down from the project to Source Packages→META-INF.
Double-click on CalculatorWSService.xml, and verify that lines similar to
the following are present:
<wsp:All>
<wsaws:UsingAddressing xmlns:wsaws=
"http://www.w3.org/2006/05/addressing/wsdl"/>
<sc:CallbackHandlerConfiguration
wspp:visibility="private">
<sc:CallbackHandler default="wsitUser"
name="usernameHandler"/>
<sc:CallbackHandler default="changeit"
name="passwordHandler"/>
</sc:CallbackHandlerConfiguration>
<sc:TrustStore wspp:visibility="private" location=
"home\glassfish\domains\domain1\config\cacerts.jks"
storepass="changeit" peeralias="xws-security-server"/>
</wsp:All>
An example of this file can be viewed in the tutorial by clicking this link:
Client-Side WSIT Configuration Files (page 130).
10.Right-click on the CalculatorWSServletClient node and select Run
Project.
11.Follow the steps to secure the client application as described in the next
section.
<wsp:All>
<wsaws:UsingAddressing xmlns:wsaws=
"http://www.w3.org/2006/05/addressing/wsdl"/>
<sc:KeyStore wspp:visibility="private" location=
"C:\Sun\glassfish\domains\domain1\config\keystore.jks"
storepass="changeit" alias="xws-security-server"
keypass="changeit"/>
<sc:TrustStore wspp:visibility="private" location=
"C:\Sun\glassfish\domains\domain1\config\cacerts.jks"
storepass="changeit"
peeralias="xws-security-server"/>
</wsp:All>
9. Compile and run this application by right-clicking on the Calculator-
WSServletClient node and selecting Run Project.
NOTE: For Transport Security, the keystore and truststore files are config-
ured outside of the NetBeans UI, in GlassFish. The keystore and truststore
files for basic SSL come pre-configured with GlassFish, so there are no
additional steps required for this configuration.
7. To require the service to use the HTTPS protocol, you have to specify the
security requirements in the service’s application deployment descriptor,
which is web.xml for a web service implemented as a servlet. To specify
the security information, follow these steps:
a. From your web service application expand Web Pages→WEB-INF.
b. Double-click web.xml to open it in the editor.
c. Select the Security tab.
d. On the Security Constraints line, click Add Security Constraint.
e. Under Web Resource Collection, click Add.
f. Enter a Name for the Resource, CalcWebResource. Enter the URL Pat-
tern to be protected, /*. Select which HTTP Methods to protect, for
example, POST. Click OK to close this dialog.
g. Check the Enable User Data Constraint box. Select CONFIDENTIAL
as the Transport Guarantee to specify that the application uses SSL.
h. Click the XML tab to view the resulting deployment descriptor addi-
tions.
8. Right-click the CalculatorApplication node and select Run Project. If the
server presents its certificate, s1as, accept this certificate. A browser will
open and display the WSDL file for the application.
9. Follow the steps to secure the client application as described in the next
section.
106 USING WSIT SECURITY
In some cases, you might get an error dialog telling you that the URL
https://<fully-qualified-hostname>:8181/CalculatorAppli-
cation/CalculatorWSService?wsdl couldn't be downloaded. How-
ever, this the correct URL, and it does load when you run the service.
So, when this error occurs, repeat the steps that create the Web Service
Client using the secure WSDL. The second time, the web service refer-
ence is created and you can continue creating the client.
NOTE: Whenever you make changes on the service, refresh the client so
that the client will pick up the change. To refresh the client, right-click the
node for the Web Service Reference for the client, and select Refresh Cli-
ent.
2. Compile and run this application by right-clicking on the Calculator-
WSServletClient node and selecting Run Project.
10.To require the service to use SSL, you have to specify the security require-
ments in the service’s application deployment descriptor, which is
web.xml for a web service implemented as a servlet. To specify the secu-
rity information, follow these steps:
a. From your web service application expand Web Pages→WEB-INF.
b. Double-click web.xml to open it in the editor.
c. Select the Security tab.
d. On the Security Constraints line, click Add Security Constraint.
e. Under Web Resource Collection, click Add.
f. Enter a Name for the Resource, CalcWebResource. Enter the URL Pat-
tern to be protected, /*. Select which HTTP Methods to protect, for
example, POST. Click OK to close this dialog.
g. Check the Enable User Data Constraint box. Select CONFIDENTIAL
as the Transport Guarantee to specify that the application uses SSL.
h. Click the XML tab to view the resulting deployment descriptor addi-
tions.
EXAMPLE: SAML AUTHORIZATION OVER SSL (SA) 109
In some cases, you might get an error dialog telling you that the URL
https://<fully-qualified-hostname>:8181/CalculatorAppli-
cation/CalculatorWSService?wsdl couldn't be downloaded. How-
ever, this the correct URL, and it does load when you run the service.
So, when this error occurs, repeat the steps that create the Web Service
Client using the secure WSDL. The second time, the web service refer-
ence is created and you can continue creating the client.
110 USING WSIT SECURITY
<h1>JSP Page</h1>
• Securing the Example Web Service Client Application (STS) (page 120)
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceProvider;
import javax.xml.transform.Source;
import javax.xml.ws.handler.MessageContext;
b. Add the following Resource annotation after the line
public class MySTS implements javax.xml.ws.Pro-
vider<Source> {:
@Resource protected WebServiceContext context;
c. Change the following line of code:
public class MySTS implements
javax.xml.ws.Provider<Source>
to:
public class MySTS extends BaseSTSImpl implements
javax.xml.ws.Provider<Source>
d. For the invoke method, replace the return null line with the follow-
ing return statement:
return super.invoke(source);
e. Add the following method after the invoke method:
protected MessageContext getMessageContext() {
MessageContext msgCtx = context.getMessageContext();
return msgCtx;
}
12.Back in the Projects window, expand the MySTSProject node, then
expand the Web Services node. Right-click on the MySTSSer-
vice[IMySTSService_Port] node, and select Edit Web Service Attributes
to configure the STS.
13.Select Secure Service if it’s not already selected.
14.Verify that the Security Mechanism of Username Authentication with
Symmetric Keys is selected.
15.Select the Configure button. For Algorithm Suite, verify that Basic128 bit
is selected (so that it matches the value selected for the service.) For the
Key Size, verify that 128 is selected. Select OK to close the configuration
dialog.
16.Select Act as Secure Token Service (STS). Click OK to close the Select
STS Service Provider dialog.
120 USING WSIT SECURITY
17.Click the Keystore button to provide your keystore with the alias identify-
ing the service certificate and private key. To do this, click the Load Aliases
button and then select wssip. Click OK to close the dialog.
18.Click OK to close the WSIT Configuration dialog.
A new file is added to the project. To view the WSIT configuration file,
expand Web Pages→WEB-INF→wsdl→MySTS, then double-click the
file MySTSService.wsdl. This file contains the sc:KeyStore element.
19.Right-click the MySTSProject tab, select Properties. Select the Run cate-
gory, and enter the following in the Relative URL field: /MySTSSer-
vice?wsdl.
20.Run the Project (right-click the project and select Run Project). The STS
WSDL displays in the browser.
21.Follow the steps to secure the client application as described in the next
section.
Further Information
For more information on securing web applications using the WSIT technology,
visit the Project Tango web site at https://wsit.dev.java.net/. On this page,
you will find information about the specifications implemented in this product,
source code, support information, links to documentation updates, and much
more.
Some other sources that contain blogs and/or screencasts about using WSIT
include the following:
• Sun WSIT Bloggers
http://pipes.yahoo.com/pipes/
pipe.info?_id=2iWQPSDG2xGT0WC7p2IyXQ
http://planet.sun.com/webservices/group/blogs/
• Project Tango: An Overview
https://wsit.dev.java.net/docs/tango-overview.pdf
• Web Services blog
http://blogs.sun.com/arungupta/category/webservices
• Manual Web Service Configuration In From Java Case (and others)
http://blogs.sun.com/japod/date/20070226
• Develop WSTrust Application Using NetBeans (and others)
http://blog.sun.com/shyamrao/
• Security in WSIT (and others)
http://blogs.sun.com/ashutosh/category/Sun
• WSIT Screencasts
https://wsit.dev.java.net/screencasts.html
• Specifications Implemented by WSIT
https://wsit.dev.java.net/specification-links.html
7
Further Detail on WSIT
Security Features
THIS chapter provides a bit more descriptive material for WSIT security fea-
tures in NetBeans Integrated Development Environment (the IDE)
This chapter covers the following topics:
• Issues Addressed Using Security Mechanisms (page 123)
• Understanding WSIT Configuration Files (page 125)
• Security Mechanism Configuration Options (page 133)
tiator to the recipient, and for encryption from recipient to initiator. The
recipient token is used for encryption from initiator to recipient, and for the
message signature from recipient to initiator.
• Some organizations have a Kerberos infrastructure, while other organiza-
tions have a PKI infrastructure (asymmetric binding). WS-Trust allows
two communicating parties having different security infrastructure to com-
municate securely with one another. In this scenario, the client authenti-
cates with a third party (STS) using its infrastructure. The STS returns a
(digitally-signed) SAML token containing authorization and authentica-
tion information regarding the client, along with a key. The client then sim-
ply relays the token to the server and uses the STS-supplied key to ensure
integrity and confidentiality of the messages sent to the server.
• Symmetric binding is used for message protection. This binding has two
binding specific token properties: encryption token and signature token. If
the message pattern requires multiple messages, this binding defines that
the encryption token used from initiator to recipient is also used from
recipient to initiator. Similarly, the signature token used from initiator to
recipient is also used from recipient to initiator.
In some cases, the client does not have its own certificates. In this case,
the client can choose a security mechanism that makes use of symmetric
binding and could use a Username token as a signed supporting token for
authentication with the server. The symmetric binding in this case serves
the purpose of integrity and confidentiality protection.
• In the absence of a notion of secure session, the client would have to reau-
thenticate with the server upon every request. In this situation, if the client
is sending a Username token, the client will be asked for its username and
password on each request, or, if the client is sending a certificate, the valid-
ity of the certificate has to be established with every request. This is expen-
UNDERSTANDING WSIT CONFIGURATION FILES 125
The service-side WSIT Configuration file that is used when the web service is
deployed can be viewed by expanding the Web Pages→WEB-INF elements of
the application in the tree, and then double-clicking the wsit-
<package>.<service>.xml file to open it in the editor.
<wsp:PolicyReference
URI="#CalculatorWSPortBinding_add_Output_Policy"/>
</wsdl:output>
</wsdl:operation>
</binding>
<service name="CalculatorWSService">
<wsdl:port name="CalculatorWSPort"
binding="tns:CalculatorWSPortBinding"/>
</service>
<wsp:Policy wsu:Id="CalculatorWSPortBindingPolicy">
<wsp:ExactlyOne>
<wsp:All>
<wsaws:UsingAddressing
xmlns:wsaws="http://www.w3.org/2006/05/addressing/
wsdl"/>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:ProtectionToken>
<wsp:Policy>
<sp:X509Token
sp:IncludeToken="http://schemas.xmlsoap.org/
ws/2005/07/
securitypolicy/IncludeToken/Never">
<wsp:Policy>
<sp:WssX509V3Token10/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:ProtectionToken>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp/>
<sp:OnlySignEntireHeadersAndBody/>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128/>
</wsp:Policy>
</sp:AlgorithmSuite>
</wsp:Policy>
</sp:SymmetricBinding>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier/>
<sp:MustSupportRefIssuerSerial/>
<sp:MustSupportRefThumbprint/>
128 FURTHER DETAIL ON WSIT SECURITY FEATURES
<sp:MustSupportRefEncryptedKey/>
</wsp:Policy>
</sp:Wss11>
<sp:SignedSupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://schemas.xmlsoap.org/ws/
2005/07/securitypolicy/IncludeToken/
AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken10/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
<sc:KeyStore wspp:visibility="private"
alias="xws-security-server" storepass="changeit"
type="JKS" location="C:\Sun\glassfish\domains\
domain1\config\keystore.jks"/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy
wsu:Id="CalculatorWSPortBinding_add_Input_Policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:EncryptedParts>
<sp:Body/>
</sp:EncryptedParts>
<sp:SignedParts>
<sp:Body/>
<sp:Header Name="To" Namespace="http://
www.w3.org/
2005/08/addressing"/
<sp:Header Name="From" Namespace="http://www.w3.org/
2005/08/addressing"/>
<sp:Header Name="FaultTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="ReplyTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="MessageID"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="RelatesTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="Action" Namespace="http:/
/www.w3.org/
2005/08/addressing"/>
<sp:Header Name="AckRequested"
SERVICE-SIDE WSIT CONFIGURATION FILES 129
Namespace="http://schemas.xmlsoap.org/ws/2005/02/
rm"/>
<sp:Header Name="SequenceAcknowledgement"
Namespace="http://schemas.xmlsoap.org/ws/2005/02/
rm"/>
<sp:Header Name="Sequence"
Namespace="http://schemas.xmlsoap.org/ws/2005/02/
rm"/>
</sp:SignedParts>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy
wsu:Id="CalculatorWSPortBinding_add_Output_Policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:EncryptedParts>
<sp:Body/>
</sp:EncryptedParts>
<sp:SignedParts>
<sp:Body/>
<sp:Header Name="To" Namespace="http://
www.w3.org/
2005/08/addressing"/>
<sp:Header Name="From" Namespace="http://www.w3.org/
2005/08/addressing"/>
<sp:Header Name="FaultTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="ReplyTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="MessageID"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="RelatesTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="Action"
Namespace="http://www.w3.org/2005/08/addressing"/>
<sp:Header Name="AckRequested"
Namespace="http://schemas.xmlsoap.org/ws/2005/02/
rm"/>
<sp:Header Name="SequenceAcknowledgement"
Namespace="http://schemas.xmlsoap.org/ws/2005/02/
rm"/>
<sp:Header Name="Sequence"
Namespace="http://schemas.xmlsoap.org/ws/2005/02/
rm"/>
</sp:SignedParts>
130 FURTHER DETAIL ON WSIT SECURITY FEATURES
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</definitions>
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://calculator.me.org/"
name="CalculatorWSService"
xmlns:tc="http://schemas.sun.com/ws/2006/05/trust/client"
xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy"
xmlns:sc="http://schemas.sun.com/2006/03/wss/client">
<types>
<xsd:schema>
<xsd:import namespace="http://calculator.me.org/"
schemaLocation="http://localhost:8080/CalculatorApplication/
CalculatorWSService?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="add">
<part name="parameters" element="tns:add"></part>
</message>
<message name="addResponse">
<part name="parameters" element="tns:addResponse"></part>
</message>
<portType name="CalculatorWS">
<operation name="add">
<input message="tns:add"></input>
<output message="tns:addResponse"></output>
</operation>
</portType>
<binding name="CalculatorWSPortBinding"
type="tns:CalculatorWS">
<wsp:PolicyReference URI="#CalculatorWSPortBindingPolicy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/
http" style="document"></soap:binding>
<operation name="add">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="CalculatorWSService">
<port name="CalculatorWSPort"
binding="tns:CalculatorWSPortBinding">
<soap:address location="http://localhost:8080/
CalculatorApplication/CalculatorWSService"></soap:address>
</port>
</service>
<wsp:Policy wsu:Id="CalculatorWSPortBindingPolicy">
132 FURTHER DETAIL ON WSIT SECURITY FEATURES
<wsp:ExactlyOne>
<wsp:All>
<tc:PreconfiguredSTS wspp:visibility="private"/>
<sc:CallbackHandlerConfiguration
wspp:visibility="private">
<sc:CallbackHandler default="wsitUser"
name="usernameHandler"/>
<sc:CallbackHandler default="changeit"
name="passwordHandler"/>
</sc:CallbackHandlerConfiguration>
<sc:KeyStore wspp:visibility="private"
storepass="changeit" type="JKS"
location="C:\Sun\glassfish\domains\domain1\config\keystore.jks
"/>
<sc:TrustStore wspp:visibility="private"
storepass="changeit" type="JKS"
location="C:\Sun\glassfish\domains\domain1\config\cacerts.jks"
peeralias="xws-security-server"/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</definitions>
Option Description
Option Description
Establish Secure Ses- When this option and Require Derived Keys are both enabled, a
sion (Secure Conversa- derived key will be used. If not, the original session key will be
tion) used.
Option Description
Issuer: http://131.107.72.15/
Security_Federation_SecurityTokenService_Indigo
/Symmetric.svc/
Scenario_5_IssuedTokenForCertificate_MutualCert
ificate11
Option Description
Require Derived Keys A derived key is a cryptographic key created from a password
or other user data. Derived keys allow applications to create ses-
Require Derived Keys sion keys as needed, eliminating the need to store a particular
for: key. The use of the same session key (for example, when using
Issued Token Secure Conversation) for repeated message exchanges is some-
Secure Session times considered a risk. To reduce that risk, enable Require
X509 Token Derived Keys.
When the WSS Version is 1.1, select this option to reduce the
risk of attacks because signature confirmation indicates that the
responder has processed the signature in the request. For more
Require Signature Con-
information, read section 8.5, Signature Confirmation, of the
firmation
Web Services Security: SOAP Message Security 1.1 specifica-
tion at http://www.oasis-open.org/committees/download.php/
16790/wss-v1.1-spec-os-SOAPMessageSecurity.pdf.
Option Description
T HIS chapter describes how to use the two supported web containers—Glass-
Fish version 2 or Apache Tomcat 5.5—to create, build, and deploy a web service
and a client that use the Web Services Interoperability Technologies (WSIT).
This chapter also includes examples of the files you must create and the build
directories.
To run the examples described in this chapter, download the WSIT samples kits,
wsit-enabled-fromjava.zip and wsit-enabled-fromwsdl.zip, from the fol-
lowing location:
https://wsit.dev.java.net/source/browse/wsit/wsit/docs/
howto/
You could also use NetBeans IDE to create and deploy WSIT web services and
clients. The IDE provides a graphical user interface (GUI) and does many of the
manual steps described in this chapter for you, thus reducing the amount of cod-
ing and processing required. For an example that creates, builds, and deploys a
web service and a web service client using NetBeans IDE, see Chapter 2.
139
140 WSIT EXAMPLE USING A WEB CONTAINER WITHOUT NETBEANS
<wsp:Policy wsu:Id="AddNumbers_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsaw:UsingAddressing/>
<wsrm:RMAssertion>
142 WSIT EXAMPLE USING A WEB CONTAINER WITHOUT NETBEANS
<wsrm:InactivityTimeout Milliseconds="600000"/>
<wsrm:AcknowledgementInterval Milliseconds="200"/>
</wsrm:RMAssertion>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
@WebService
public class AddNumbersImpl {
@WebMethod(action="addNumbers")
public int addNumbers(int number1, int number2)
throws AddNumbersException {
CREATING A WEB SERVICE 143
When developing a web service from scratch or based on an existing Java class,
WSIT features are enabled using a configuration file. That file, wsit-<pack-
age>.<service>.xml, is written in WSDL format. An example configuration
file can be found in the accompanying samples:
wsit-enabled-fromjava/etc/wsit-fromjava.server.AddNumber-
sImpl.xml
• web.xml
• These files are standard in any Ant build environment. Examples of these
files are provided in the wsit-enabled-fromjava sample directory.
• build.xml
• build.properties
package fromjava.server;
import javax.jws.WebService;
import javax.jws.WebMethod;
@WebService
public class AddNumbersImpl {
@WebMethod(action="addNumbers")
public int addNumbers(int number1, int number2)
throws AddNumbersException {
if (number1 < 0 || number2 < 0) {
throw new AddNumbersException(
"Negative number cannot be added!",
"Numbers: " + number1 + ", " + number2);
}
return number1 + number2;
}
}
wsit-<package>.<service>.xml File
This file is the WSIT configuration file. It defines which WSIT technologies are
enabled in the web service. The snippet shown below illustrates how to enable
the WSIT reliable messaging technology in a wsit-<package>.<service>.xml
file.
<wsp:Policy wsu:Id="AddNumbers_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsaw:UsingAddressing/>
<wsrm:RMAssertion>
<wsrm:InactivityTimeout Milliseconds="600000"/>
<wsrm:AcknowledgementInterval Milliseconds="200"/>
</wsrm:RMAssertion>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<INSTALL>/wsit-enabled-fromwsdl/etc/AddNumbers.wsdl
146 WSIT EXAMPLE USING A WEB CONTAINER WITHOUT NETBEANS
To Create a web service from WSDL, create the following source files:
• WSDL File (page 146)
• Web Service Implementation File (page 147)
• custom-server.xml
• web.xml
• sun-jaxws.xml
• build.xml
• build.properties
The following files are standard files required for JAX-WS. Examples of these
files are provided in the fromwsdl sample directory.
• custom-server.xml
• sun-jaxws.xml
• web.xml
The build.xml and build.properties files are standard in any Ant build envi-
ronment. Examples of these files are provided in the respective samples directo-
ries.
The sample files provided in this tutorial define a web service that takes two inte-
gers, adds them, and returns the result. If one of the integers is negative, an
exception is returned.
WSDL File
You can create a WSDL file by hand or retrieve it from an existing web service
by simply pointing a web browser at the web service’s URL. The snippet shown
below illustrates how to enable the WSIT Reliable Messaging technology in a
WSDL file.
<wsp:Policy wsu:Id="AddNumbers_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsrm:RMAssertion>
<wsrm:InactivityTimeout Milliseconds="600000"/>
<wsrm:AcknowledgementInterval Milliseconds="200"/>
</wsrm:RMAssertion>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
BUILDING AND DEPLOYING THE WEB SERVICE 147
For a complete example of a WSDL file, see the AddNumbers.wsdl in the from-
wsdl example. Another benefit of AddNumbers.wsdl file is that it shows how a
WSIT-enabled WSDL is constructed. Therefore, you can use it as a reference
when you create a WSDL file or modify an existing one.
package fromwsdl.server;
import javax.jws.WebService;
import javax.jws.WebMethod;
@WebService (endpointInterface=
"fromwsdl.server.AddNumbersPortType")
public class AddNumbersImpl{
@WebMethod(action="addNumbers")
public int addNumbers (int number1, int number2)
throws AddNumbersFault_Exception {
if (number1 < 0 || number2 < 0) {
String message = "Negative number cannot be added!";
String detail = "Numbers: " + number1 + ", " + number2;
AddNumbersFault fault = new AddNumbersFault ();
fault.setMessage (message);
fault.setFaultInfo (detail);
throw new AddNumbersFault_Exception(message, fault);
}
return number1 + number2;
}
ant server
This command calls the server target in build.xml, which builds and packages
the application into a WAR file, wsit-enabled-fromjava.war, and places it in
the wsit-enabled-fromjava/build/war directory. The ant server command
also deploys the WAR file to the web container.
The ant command calls multiple tools to build and deploy the web service. The
JAX-WS annotation processing tool (apt) processes the annotated source code
and invokes the compiler itself, resulting in the class files for each of the Java
source files. In the wsit-enabled-fromjava example, the ant target build-
server-java in build.xml handles this portion of the process. Next, the indi-
vidual class files are bundled together along with the web service’s supporting
configuration files into the application’s WAR file. It is this file that is deployed
to the web container by the deploy target.
During execution of the server target, you will see a warning message. The
message refers to "Annotation types without processors". The warning is
expected and does not indicate an abnormal situation. The text is included here
for reference:
build-server-java:
[apt] warning: Annotation types without processors:
[javax.xml.bind.annotation.XmlRootElement,
javax.xml.bind.annotation.XmlAccessorType,
javax.xml.bind.annotation.XmlType,
javax.xml.bind.annotation.XmlElement]
[apt] 1 warning
BUILDING AND DEPLOYING THE WEB SERVICE 149
ant server
This command calls wsimport, which takes the WSDL description and gener-
ates a corresponding Java interface and other supporting classes. Then the Java
compiler is called to compile both the user’s code and the generated code.
Finally, the class files are bundled together into the WAR file. To see the details
of how this is done, see the build-server-wsdl and create-war targets in the
wsit-enabled-fromwsdl/build.xml file.
Deploying to GlassFish
For development purposes, the easiest way to deploy is to use the autodeploy
facility of the GlassFish application server. To do so, you simply copy your
application’s WAR file to the /autodeploy directory for the domain to which
you want to deploy. If you are using the default domain, domain1, which is set
up by the GlassFish installation process, the appropriate directory path would be
<AS_HOME>/domains/domain1/autodeploy.
150 WSIT EXAMPLE USING A WEB CONTAINER WITHOUT NETBEANS
The build.xml file which accompanies this example has a deploy target for
GlassFish. To invoke that target, run the following command in the top-level
directory of the respective examples, either wsit-enabled-fromjava or wsit-
enabled-fromwsdl, as follows.
ant deploy
Verifying Deployment
A basic test to verify that the application has deployed properly is to use a web
browser to retrieve the application’s WSDL from its hosting web container. The
following URLs retrieve the WSDL from each of the two example services. If
you are running your web browser and web container on different machines, you
need to replace localhost with the name of the machine hosting your web ser-
vice.
• http://localhost:8080/wsit-enabled-fromjava/addnumbers?wsdl
• http://localhost:8080/wsit-enabled-fromwsdl/addnumbers?wsdl
If the browser displays a page of XML tags, the web service has been deployed
and is working. If not, check the web container log for any error messages
CREATING A WEB SERVICE CLIENT 151
related to the sample WAR you have just deployed. For GlassFish, the log can be
found at <AS_HOME>/domains/domain1/logs/server.log. For Apache Tom-
cat, the appropriate log file can be found at <TOMCAT_HOME>/logs/cat-
alina.out.
package fromjava.client;
import com.sun.xml.ws.Closeable;
import java.rmi.RemoteException;
number1 = -10;
System.out.printf ("Invoking addNumbers(%d, %d)\n",
number1, number2);
result = port.addNumbers (number1, number2);
System.out.printf (
"The result of adding %d and %d is %d.\n",
CREATING A WEB SERVICE CLIENT 153
This file specifies two positive integers that are to be added by the web service,
passes the integers to the web service and gets the results from the web service
via the port.addNumbers method, and prints the results to the screen. It then
specifies a negative number to be added, gets the results (which should be an
exception), and prints the results (the exception) to the screen.
<jaxb:package name="fromwsdl.client"/>
</jaxb:schemaBindings>
</bindings>
</bindings>
T HIS chapter describes how to build and run a Microsoft Windows Communi-
cation Foundation (WCF) client that accesses the addnumbers service described
in Chapter 8.
157
158 ACCESSING WSIT SERVICES USING WCF CLIENTS
You must also deploy the addnumbers service described in Chapter 8. You can
download the service from https://wsit.dev.java.net/source/browse/
*checkout*/wsit/wsit/docs/howto/wsit-enabled-fromjava.zip.
...
port = new AddNumbersImplClient("AddNumbersImplPort");
...
...
int result = port.addNumbers (number1, number2);
...
using System;
class Client {
static void Main(String[] args) {
AddNumbersImplClient port = null;
try {
port = new AddNumbersImplClient("AddNumbersImplPort");
int number1 = 10;
int number2 = 20;
Console.WriteLine("Result is {0}.\n\n",result);
number1 = -10;
Console.Write("Adding {0} and {1}. ", number1, number2);
result = port.addNumbers (number1, number2);
Console.WriteLine("Result is {0}.\n\n",result);
port.Close();
} catch (System.ServiceModel.FaultException e) {
Console.WriteLine("Exception: " + e.Message);
if (port != null) port.Close();
}
}
}
Client.exe
You will see the following output:
Adding 10 and 20. Result is 30.
Adding -10 and 20. Exception: Negative numbers can't
be added!
162 ACCESSING WSIT SERVICES USING WCF CLIENTS
10
Data Contracts
structs. The guidelines provide guidance on using JAXB 2.0 annotations and
types so that developer friendly bindings may be generated by XML serialization
mechanisms (svcutil) on WCF client.
Not all JAXB 2.0 annotations are included here; not all are relevant from an
interoperability standpoint. For example, the annotation @XmlAccessorType pro-
vides control over default serialization of fields and properties in a Java class but
otherwise has no effect on the on-the-wire XML representation or the XML
schema generated from a Java class. Select JAXB 2.0 annotations are therefore
not included here in the guidance.
The guidance includes several examples, which use the following conventions:
• prefix xs: is used to represent XML Schema namespace
• JAXB 2.0 annotations are defined in javax.xml.bind.annotation pack-
age but, for brevity, the package name has been omitted
DataTypes
//--Schema fragment
<xs:complexType name="stockItem">
<xs:sequence>
<xs:element name="wholeSalePrice" type="xs:double"
WEB SERVICE - START FROM JAVA 165
minOccurs="0"/>
<xs:element name="retailPrice" type="xs:double"/>
</xs:sequence>
</xs:complexType>
BigDecimal
Guideline: Limit decimal values to the range and precision of .NET’s Sys-
tem.decimal.
not. For interoperability use only values within the range and precision of Sys-
tem.decimal. (See System.decimal.Minvalue and System.decimal.Max-
value.) Any values outside of this range require a customized .NET client.
java.net.URI
Guideline: Use the @XmlSchemaType annotation for a strongly typed binding to a
.NET client generated with the DataContractSerializer.
java.net.URI maps to xs:string. .NET maps xs:string to System.string.
Annotation @XmlSchemaType can be used to define a more strongly typed bind-
ing to a .NET client generated with the DataContractSerializer. @XmlSche-
maType can be used to map java.net.URI to xs:anyURI. .NET’s
DataContractSerializer and XmlSerializer bind xs:anyURI differently:
{
get { return this.uriField; }
set { this.uriField = value; }
}
}
Duration
Guideline: Use .NET’s System.Xml.XmlConvert to generate a lexical representation
of xs:duration when the binding is to a type of System.string.
javax.xml.datatype.Duration maps to xs:duration. .NET maps xs:dura-
tion to a different datatype for DataContractSerializer and XmlSerializer.
{
get { return this.periodField; }
set { this.periodField = value; }
}
}
Binary Types
java.awt.Image, javax.xml.transform.Source, and javax.activa-
tion.DataHandler map to xs:base64Binary. .NET maps xs:base64Binary to
byte[].
JAXB 2.0 provides the annotation @XmlMimeType, which supports specifying the
content type, but .NET ignores this information.
Example: Mapping java.awt.Image without @XmlMimeType
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
{
get { return this.photoField; }
set { this.photoField = value; }
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
XMLGregorianCalendar
Guideline: Use
java.xml.datatype.XMLGregorianCalendar instead of
java.util.Date and java.util.Calendar.
public System.Runtime.Serialization.ExtensionDataObject
ExtensionData
{
get { return this.extensionDataField; }
set { this.extensionDataField = value; }
}
UUID
Guideline: Use Leach-Salz variant of UUID at runtime.
WEB SERVICE - START FROM JAVA 175
public System.Runtime.Serialization.ExtensionDataObject
ExtensionData
{
get { return this.extensionDataField; }
set { this.extensionDataField = value; }
}
Type Variable
A typed variable maps to xs:anyType. .NET maps xs:anyType to Sys-
tem.Object.
// Java class
public class Shape <T>
{
private T xshape;
<xs:complexType name=”shape”>
<xs:sequence>
<xs:element name=”xshape” type=”xs:anyType”
minOccurs=”0”/>
</xs:sequence>
</xs:complexType>
Collections
Java collections types - java.util.Collection and its subtypes, array, List,
and parameterized collection types (e.g. List<Integer>) can be mapped to
XML schema in different ways and can be serialized in different ways. The fol-
lowing examples show .NET bindings.
WEB SERVICE - START FROM JAVA 177
<po>
<items> 1 </items>
<items xsi:nil=true/>
<items> 3 </items>
</po>
List of values
A collection such as List<Integer> can be mapped to a list of XML values (i.e.
a XML schema list simple type) using annotation @XmlList. .NET maps list
simple type to a .NET System.string.
WEB SERVICE - START FROM JAVA 179
Arrays
Example: Single and multidimensional Arrays
Fields/Properties
The following guidelines apply to mapping of Javabean properties and Java
fields, but for brevity Java fields are used.
@XmlElement
The @XmlElement annotation maps a property/field to an XML element. This is
also the default mapping in the absence of any other JAXB 2.0 annotations. The
annotation parameters in @XmlElement can be used to specify whether the ele-
ment is optional or required, nillable or not. The following examples illustrate
the corresponding bindings in the .NET client.
WEB SERVICE - START FROM JAVA 181
@XmlElement(nillable=true, required=true)
public java.math.BigDecimal price;
@XmlAttribute
A property/field can be mapped to an XML attribute using @XmlAttribute
annotation. .NET binds an XML attribute to a property.
Example: Mapping field/property to XML attribute
@XmlElementRefs
Guideline: @XmlElementRefs maps to a xs:choice. This binds to a property
with name “item” in the C# class. If there is another field/property named “item”
in the Java class, there will be a name clash that .NET will resolve by generating
name. To avoid the nameclash, either change the name or use customization, for
example @XmlElement(name=”foo”).
Example: Mapping a field/property using @XmlElementRefs
@XmlRootElement(name="plane")
public class PlaneType extends TransportType {}
@XmlRootElement(name="auto")
184 DATA CONTRACTS
@XmlRootElement
public class TransportType { ... }
<xs:complexType name=”autoType”>
<!-- content omitted - details not relevant to example -->
</xs:complexType>
</xs:complexType name=”planeType”>
<!-- content omitted - details not relevant to example -->
</xs:complexType>
[System.Xml.Serialization.XmlElementAttribute("auto",
typeof(autoType), Order=4)]
[System.Xml.Serialization.XmlElementAttribute("plane",
typeof(planeType), Order=4)]
public transportType Item
{
get { return this.itemField; }
set { this.itemField = value; }
}
Class
A Java class can be mapped to different XML schema type and/or an XML ele-
ment. The following guidelines apply to the usage of annotations at the class
level.
@XmlType(name="")
public class Item {
public String productName;
...
}
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
System.Xml.Serialization.XmlElementAttribute("item",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
IsNullable=true, Order=0)]
public purchaseOrderItem[] item
{
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
@XmlType - xs:all
Guideline: Avoid using XmlType(propOrder=:{}).
@XmlType(propOrder={}) maps a Java class to a XML Schema complex type
with xs:all content model. Since XML Schema places severe restrictions on
xs:all, the use of @XmlType(propOrder={}) is therefore not recommended.
So, the following example shows the mapping of a Java class to xs:all, but the
corresponding .NET code generated by svcutil is omitted.
WEB SERVICE - START FROM JAVA 187
Open Content
JAXB 2.0 supports the following annotations for defining open content. (Open
content allows content not statically defined in XML schema to occur in an XML
instance):
• @XmlAnyElement - which maps to xs:any, which binds to .NET type Sys-
tem.Xml.XmlElement[].
• @XmlAnyAttribute - which maps to xs:anyAttribute, which binds to
.NET type System.Xml.XmlAttribute[].
Example: Using @XmlAnyElement for open content
Enum Type
A Java enum type maps to an XML schema type constrained by enumeration fac-
ets. This, in turn, binds to .NET type enum type.
WEB SERVICE - START FROM JAVA 191
Example: Java enum -> xs:simpleType (with enum facets) -> .NET enum
Package
The following package level JAXB annotations are relevant from an interopera-
bility standpoint:
• @XmlSchema – customizes the mapping of package to XML namespace.
• @XmlSchemaType – customizes the mapping of XML schema built-in type.
The @XmlSchemaType annotation can also be used at the property/field
level, as was seen in the previous example XMLGregorianCalendar
(page 172).
@XmlSchema
A package is mapped to an XML namespace. The following attributes of the
XML namespace can be customized using the @XmlSchema annotation parame-
ters:
• elementFormDefault using @XmlSchema.elementFormDefault()
• attributeFormDefault using @XmlSchema.attributeFormDefault()
• targetNamespace using @XmlSchema.namespace()
• Associate namespace prefixes with the XML namespaces using the
@XmlSchema.ns() annotation
These XML namespace attributes are bound to .NET serialization attributes (for
example, XmlSerializer attributes).
192 DATA CONTRACTS
svcutil <wsdl-file>
Java Client
A Java client is always developed starting from a WSDL. See section, “Custom-
izations for WCF Service WSDL (page 193)” for guidelines.
CUSTOMIZATIONS FOR WCF SERVICE WSDL 193
generateElementProperty
WCF service WSDL generated from a programming language such as C# using
DataContractSerializer may contain XML Schema constructs which result
in JAXBElement<T> in generated code. A JAXBElement<T> type can also some-
times be generated when a WSDL contains advanced XML schema features
such as substitution groups or elements that are both optional and nillable. In all
such cases, JAXBElement<T> provides roundtripping support of values in XML
instances. However, JAXBElement<T> is not natural to a Java developer. So the
generateElementProperty customization can be used to generate an alternate
developer friendly but lossy binding. The different bindings along with the trade-
offs are discussed below.
Default Binding
The following is the default binding of an optional (minOccurs=”0”) and nill-
able(nillable=”true”) element:
// Binding
public class Person {
JAXBElement<String> getName() {...};
public void setName(JAXBElement<String> value) {...}
}
194 DATA CONTRACTS
Since the XML element “name” is both optional and nillable, it can be repre-
sented in an XML instance in one of following ways:
Customized Binding
When generateElementProperty is false, the binding is changed as follows:
<jaxb:bindings version="2.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:bindings schemaLocation="schema-importedby-wcfsvcwsdl"
node="/xs:schema">
<jaxb:globalBindings generateElementProperty=”false”/>
</jxb:bindings>
CUSTOMIZATIONS FOR WCF SERVICE WSDL 195
mapSimpleTypeDef
XML Schema Part 2: Datatype defines facilities for defining datatypes for use in
XML Schemas. .NET platform introduced the CLR types for some of the XML
schema datatypes as described in Table 10–1.
byte xs:unsignedByte
uint xs:unsignedInt
ushort xs:unsignedShor
ulong xs:unsignedLong
However, there are no corresponding Java types that map to the XML Schema
types listed in Table 10–1. Furthermore, JAXB 2.0 maps these XML schema
types to Java types that are natural to Java developer. However, this results in a
mapping that is not one-to-one. For example:
• xs:int -> int
• xs:unsignedShort -> int
The lack of a one-to-one mapping means that when XML Schema types shown
in Table 10–1 are used in an xsi:type construct, they won’t be preserved by
default across an unmarshal followed by marshal operation. For example:
// C# web method
public Object retObject(Object objvalue);
<objvalue xsi:type=”xs:int”/>
One way to preserve and roundtrip the xsi:type is to use the mapSimpleType-
Def customization. The customization makes the mapping of XML Schema Part
2 datatypes one--to-one by generating additional Java classes. Thus,
xs:unsignedShort will be bound to its own class rather than int, as shown:
<objvalue xsi:type=”xs:unsignedShort”/>
Guideline: Use mapSimpleTypedef customization where roundtripping of XML
Schema types in Table 10–1 are used in xsi:type. However, it is preferable to
avoid the use of CLR types listed in Table 10–1 since they are specific to .NET
platform.
DEVELOPING A MICROSOFT .NET CLIENT 197
<jxb:bindings version="2.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:bindings schemaLocation="schema-importedby-wcfsvcwsdl"
node="/xs:schema">
<jaxb:globalBindings mapSimpleTypeDef="true"/>
</jaxb:bindings>
BP 1.1 Conformance
JAX-WS 2.0 enforces strict Basic Profile 1.1 compliance. The following are
known cases where .NET framework does not enforce strict BP 1.1 semantics
and their usage can lead to interoperability problems.
BP 1.1 R2211
In rpclit mode, BP 1.1 http://www.ws-i.org/Profiles/BasicProfile-
1.1-2006-04-10.html, R2211 disallows the use of xsi:nil in part accessors
(see the R2211 for the actual text). From a developer perspective this means that
in rpclit mode, JAX-WS does not allow a null to be passed in a web service
method parameter.
<!-- In rpclit mode, the above Java web service method will
throw an exception if the following XML instance with xsi:nil
is passed by a .NET client. -->
<RetByteArray xmlns="http://tempuri.org/">
<inByteArray a:nil="true" xmlns=""
xmlns:a="http://www.w3.org/2001/XMLSchema-instance"/>
</RetByteArray>
11
Using Atomic
Transactions
THIS chapter explains how to configure and use WSIT WS-TX, which imple-
ments Web Services-AtomicTransactions (WS-AT) and Web Services-Coordina-
tion (WS-Coordination). WSIT WS-TX enables Java EE transactions to work
across heterogeneous systems that support WS-AT and WS-Coordination.
199
200 USING ATOMIC TRANSACTIONS
The "Edit Web Service Attributes" feature in the NetBeans WSIT plug-in
is used to configure Transaction Attributes of each web service operation.
2. SimpleServiceASCMTEJB, a web service implemented as container-man-
aged transaction Enterprise bean (CMT EJB)
The basicWSTX example was initially designed so it could be run in either one or
in two GlassFish domains. If you run the example in one domain, only one coor-
dinator is used; no WS-Coordination protocol messages will be exchanged. We
explain how to run the example in two domains so both protocols, WS-Coordi-
nation and WS-AtomicTransaction (WS-AT), are used, as shown in Figure 11–1.
We also provide the msclient client, which is the equivalent of the client servlet
shown in Domain 2.
Figure 11–2 shows the components that make up the two domain example.
Again, the msclient client would be equivalent to the client servlet in Domain 2
in this figure as well.
202 USING ATOMIC TRANSACTIONS
cd <INSTALL>/wsittutorial/examples/wstx/basicWSTX/Sam-
pleService
b. Issue the following command to configure your environment to run the
example:
ant setup
4. Register the GlassFish server instances (domain1 and domain2) in the Net-
Beans IDE.
a. If the Sun Java System Application Server (domain1) is already regis-
tered, go to Step 4g. If it is not, go to Step 4b.
b. In the Runtime tab, right-click Servers and select Add Server. The Add
Server Instance dialog displays.
c. Choose the server (Sun Java System Application Server) from the pull-
down and give it a descriptive name, such as Sun Java System Applica-
tion Server - domain1 (Server), and then press Next.
d. Press the Browse button, navigate to the location where the GlassFish
server is installed, then press Choose.
e. Select domain1 from the pulldown, then press Next.
f. Enter the admin account password (adminadmin) in the Admin Pass-
word field then press Finish. The server instance you just registered is
the one in which you will run the web service (SampleService).
g. Right-click Servers and select Add Server. The Add Server Instance dia-
log displays.
h. Choose the server (Sun Java System Application Server) from the pull-
down and give it a descriptive name, such as Sun Java System Applica-
tion Server - domain2 (Client), and then press Next.
i. Press the Browse button, navigate to the location where the GlassFish
server is installed, then press Choose.
j. Select domain2 from the pulldown, then press Next.
k. Enter the admin account password (adminadmin) in the Admin Pass-
word field then press Finish. The server instance you just registered is
the one in which you will run the web service client (SampleService-
Client).
Select the indicated setting for each of the following operations from the
Transaction pulldown:
• Set init to Required
• Set publishRequired to Required
• Set publishSupports to Supported
• Set verify to Required
206 USING ATOMIC TRANSACTIONS
Figure 11–3 shows how this is done for the publishRequired oper-
ation.
e. Click OK.
play the results for both in a pop-up browser window, as shown in Figure
11–4.
A clients
Advanced Configuration page 48, 51, web service
82, 96 securing 48
aliases client-side proxy 5
specifying 77 configuration file
annotations client 130
WebService 24, 144 service 126
application messages configuration files
being lost 5 WSIT 125
Application Server
adding users to 73–74
authentication credentials 59 D
derived session keys 6
B
binary objects E
encoding 4 Edit Web Service Attributes 48, 95
bootstrapping and configuration 3 endpoints
process steps 3 descriptions 33
references 33
server-side 33
C examples
Certificate Validator field 86 required software x
certificates
digital 63
v3 75 F
validating 86 flow control 44
Client/Service Trust Requirements page
48, 51, 82, 96
Client/Service WSS Requirements page
48, 51, 82, 96
209
210 INDEX
I N
inactivity timeout 44 network connections
being dropped 5
J
Java file O
annotations 24, 38, 144 operations
skeleton 25 securing 86
JAX-WS ordered delivery 43
defined 1
P
K password
keystore default 59
aliases 77 proxy
configuring 78 lifetime 5
Keystore Configuration options 78, 81,
85, 87
Keystore Configuration page 48, 51, 82,
Q
96
Quality of Service 5
keystores
alias 79, 94
configuring 48, 50–51, 75, 78, 81–
82, 85, 87, 96 R
location 79, 94 Reliable Message Delivery 134
reliable messaging 134
advantages and disadvantages 5
configuration options 43
M
description 5
Message Elements/Parts to Sign and En-
messages being lost 5
crypt 48, 51, 82, 96
network connections being dropped
message optimization
5
binary objects 4
ordered delivery 5
description 4
performance degradation 44
network performance 4
quality of service 5
secure conversation 42
secure conversation 45
messages
sequence identifier 5
encrypting elements 48, 51, 82, 96
session management 5
encrypting parts 48, 51, 82, 96
when to use it 5
securing 86
reliable messaging options
signing elements 48, 51, 82, 96
enabled/disabled 43
signing parts 48, 51, 82, 96
flow control 44
MetadataExchangeRequest 3
inactivity timeout 44
multiple-message-exchange sequence 6
INDEX 211
12 V
Web Services Secure Conversation validating
11, 14 password 85
Web Services Security 13 SAML tokens 86
Web Services Security Policy 14 token timestamps 85
Web Services Trust 14 username 85
WSDL 9 validators
SSL configuring 85
configuring 50, 69
STS
configuring 50, 91
supporting token options 90 W
WCF 6
platform 7
Web services 7
T Web service
Timestamp Validator field creating 25
timestamps creating and deploying 24, 38, 144
validating 85 Java code 24
tokens Web Service Attributes
supporting editor 38
options 90 web services
trust attributes
configuring 48, 51, 82, 96 editing 48, 51, 58, 82, 95–96
Truststore Configuration page 80 securing 48
truststores Web Services Description Language
configuring 50, 75, 80 See WSDL 33
location 81 Web Services Interoperability Technolo-
peer alias 82 gy 2
typographical conventions xi See WSIT 7
Web services trust
description 6
U Windows Communication Foundation
username See WCF 6
default 59 WSDL 3, 9, 33
validating 85 wsimport 3
username authentication WSIT 3
configuring and Indigo 6
client 58 configuration file
Username Validator field 85 client 130
users service 126
adding to Application Server 73–74 description 2
creating 73 joint testing 7
platform 7
Web service 7
INDEX 213
wsit-*.xml file
client 130
service 126
WS-Metadata Exchange protocol 9
WS-Secure Conversation 6
WS-Security
configuring 48, 51, 82, 96
WS-Trust
configuring 48, 51, 82, 96
X
XML Infoset 11
214 INDEX