JEUS Web Service Guide 

JEUS v7.0 Fix#3

Document Information

Document Name: JEUS Web Service Guide 

Document Created: 2014-08-29

Software Version: JEUS v7.0 Fix#3

Document Version: v2.1.5


Table of Contents

About This Document
1. Introduction to Web Services
1.1. Basic Concept of a Web Service
1.2. Web Service Standards
1.2.1. SOAP Standard
1.2.2. WSDL Standard
1.2.3. UDDI Standard
1.2.4. JAX-WS, JAXB, StAX Standards
1.2.5. JAX-RPC Standard
1.2.6. SAAJ Standard
1.3. SOAP Message Exchange and Encoding
2. JEUS Web Services
2.1. Basic Architecture
2.2. Designing Web Services
2.2.1. Selecting a Web Service Backend
2.2.2. RPC-oriented and Document-oriented Information Exchanges
2.2.3. Web Service Implementation Methods
2.2.4. Creating SOAP Message Handlers
I. JEUS 7 Web Services
3. JEUS Web Service Implementation
3.1. Overview
3.2. Implementing Web Services from Java Classes
3.3. Implementing EJB Web Services
3.4. Implementing Web Services from WSDL
4. Creating and Deploying Web Services
4.1. Overview
4.2. Creating and Deploying Java Class Web Services
4.3. Creating and Deploying EJB Web Services
4.4. Creating and Deploying WSDL Web Services
4.5. How to Determine an Endpoint Address
4.5.1. Servlet Endpoint
4.5.2. EJB Endpoint
5. Invoking Web Services
5.1. Overview
5.2. Web Service Invocation Using Dynamic Proxy
5.2.1. Creating Client Artifacts
5.2.2. Java SE Client Invocation
5.2.3. Java EE Client Invocation
5.3. Web Service Invocation Using Dispatch Method
6. Standardized Binding Declaration and Customization
6.1. Overview
6.2. Declaring Standard Binding
6.2.1. Declaring in External Documents (Files)
6.2.2. Declaring in WSDL Documents
6.3. Standard Binding Customization
6.3.1. Global Bindings
6.3.2. Customizing a Package Name
6.3.3. Wrapper Style
6.3.4. Asynchronization
6.3.5. Provider Interface
6.3.6. Customizing Class Name
6.3.7. Customizing Java Methods
6.3.8. Customizing Java Parameters
6.3.9. Customizing XML Schema
6.3.10. Customizing Handler Chains
7. Handler Framework
7.1. Overview
7.2. Handler Chain Execution Order
7.3. Handler Class Organization
7.3.1. Declaring Handler Classes
7.4. Configuring a Handler Class
7.4.1. Creating a Web service from Java Class
7.4.2. Creating a Web Service from WSDL
7.4.3. Creating a Client
7.5. Example of a Web Service that Use a Handler Chain
7.6. Executing Handler Framework in Web Services
8. Provider and Dispatch Interfaces
8.1. Overview
8.2. Provider Interface for Service Endpoint
8.2.1. Provider Interface
8.2.2. Example of a Provider Interface
8.2.3. Executing a Provider Interface
8.3. Client Dispatch Interface
8.3.1. Dispatch Interface
8.3.2. Example of a Dispatch Interface
8.3.3. Executing a Dispatch Interface
8.4. XML/HTTP Binding
8.4.1. RESTful Web Services
8.4.2. Example of a RESTful Web Service
8.4.3. Executing a RESTful Web Service
9. Asynchronous Web Services
9.1. Overview
9.2. Asynchronous Client Operation
9.2.1. Using a Service Endpoint Interface Stub with Asynchronous Methods
9.2.2. Using a Dispatch Interface
9.3. Asynchronous Web Services
9.3.1. Configuring Asynchronous Web Services
10. Message Transmission Using MIME Attachment
10.1. Overview
10.2. MTOM/XOP
10.2.1. Basic Operations
10.2.2. Binary Data Attachment Size Configuration
10.2.3. Example of MTOM/XOP
10.2.4. Executing MTOM/XOP Example
10.3. swaRef
10.3.1. Using swaRef
10.3.2. Example of swaRef
10.3.3. Executing swaRef Example
10.4. Processing Attachments Using Streaming Method
11. Web Services Using Fast Infoset
11.1. Overview
11.2. Using Fast Infoset
11.2.1. Content Negotiation
11.3. Example of Fast Infoset
11.4. Executing Fast Infoset Web Services
12. JAX-WS JMS Transport
12.1. Overview
12.2. Configuring JAX-WS JMS Transport
12.2.1. Configuring a JMS Server
12.2.2. Creating a Web Service
12.2.3. Configuring a WSDL
12.2.4. Creating a Web Service Client
13. Web Service Policy
13.1. Overview
13.2. Web Service Policy (WS-Policy)
13.3. Server Policy
13.3.1. Creating a Web Service from WSDL
13.3.2. Creating a Web Service from Java Classes
13.4. Client Policy
14. Web Services Addressing
14.1. Overview
14.2. Server Configurations
14.2.1. Configuring from Java Class
14.2.2. Configuring from WSDL
14.3. Client Configurations
14.4. Example
14.5. Executing the Example
15. Reliable Messaging
15.1. Overview
15.2. Server Settings
15.2.1. Using WSDL
15.2.2. Using Java Class
15.3. Client Settings
15.4. Example
15.5. Executing the Example
16. Web Service Transactions
16.1. Overview
16.2. Server Applications
16.2.1. Using WSDL
16.2.2. Using Java Class
16.3. Client Settings
16.4. Coordinator Service
16.5. Web Service Transaction Example
17. Web Service Security
17.1. Overview
17.2. Transport-level Security
17.3. Message-level Security
17.3.1. Web Service Security Policy
17.3.2. Web Service Security
17.3.3. Web Services Secure Conversation
17.3.4. Web Service Trust
17.4. Message Level Security Configurations
17.4.1. Common Configurations
17.4.2. Improving Symmetric Binding through Username Authentication
17.4.3. Mutual Certificates Security
17.4.4. SAML Authentication through SSL
17.4.5. Secure Conversation
17.4.6. Web Service Trust (WS-Trust)
17.4.7. Client Execution
17.5. How to Migrate JAX-RPC (JEUS 5) Web Service Security
17.5.1. Encryption
17.5.2. Signature
17.5.3. Timestamp
17.5.4. Username Token
17.6. How to Invoke Access-Controlled Web Services
17.6.1. Creating Portable Artifacts
17.6.2. Creating Web Service Clients
18. UDDI
18.1. Overview
18.1.1. Using UDDI
18.2. Operating UDDI Server in JEUS
18.2.1. Creating UDDI DataStore
18.2.2. Deploying JEUS UDDI Server
18.2.3. Configuring UDDI Server
18.2.4. Adding a New User
18.2.5. Starting UDDI Server
18.3. Using UDDI Explorer in JEUS Server
18.3.1. Querying UDDI Registry
18.3.2. Publishing UDDI Registry
18.3.3. Configuring JEUS UDDI Explorer
18.4. Creating UDDI Client
18.4.1. Creating UDDI Client
18.4.2. Compiling UDDI Client
18.4.3. Executing UDDI Client
18.5. How to Use XML Digital Signature
18.5.1. Digital Signature
18.5.2. How to Create XML Signature in UDDI Client
18.5.3. Verifying XML signature in UDDI Client
18.6. How to Use UDDI Subscription
18.6.1. Basic Concept
18.6.2. How to Create UDDI Subscription
18.6.3. UDDI Subscription Example
18.6.4. UDDI Subscription Client Programming
18.6.5. Configurations for Receiving E-Mail Notifications
18.7. How to Use UDDI WSDL Publishing
18.7.1. UDDI WSDL Publishing
18.7.2. Using wsdl2uddi
19. XML of JEUS Web Services
19.1. Overview
19.2. JAXB (Java Architecture for XML Binding)
19.2.1. Binding Compiler(XJC) Related Programming Techniques
19.2.2. Schemagen Programming Techniques
19.3. JAXP (Java Standard API for XML Processing)
19.3.1. StAX (Java Streaming APIs for XML Parser)
II. JAX-RPC Web Services
20. Implementing JAX-RPC Web Services
20.1. Overview
20.2. Implementing a Web Service from a Java Class
20.2.1. Example
20.2.2. Implementation Principles of Java Web Services
20.3. Implementing a Web Service from an EJB
20.3.1. Example
20.3.2. Implementation Principles of EJB Web Services
20.4. Implementing Web Services from WSDL
20.5. Using SAAJ
21. Creating and Deploying JAX-RPC Web Services
21.1. Creating and Deploying Java Web Services
21.1.1. Configuring Service Configuration File
21.1.2. Creating WSDL and JAX-RPC Mapping Files
21.1.3. Configuring Web Service DD File
21.1.4. Packaging and Deploying
21.2. Creating and Deploying EJB Web Services
21.2.1. Configuring Web Service Configuration File
21.2.2. Creating WSDL File and JAX-RPC Mapping File
21.2.3. Configuring Web Services DD File
21.2.4. Packaging and Deploying
22. Invoking JAX-RPC Web Services
22.1. Invoking JEUS JAX-RPC Web Services (Java SE client)
22.1.1. Stub Client
22.1.2. DII Client
22.2. Invoking JAX-RPC Web Services (Java EE Client)
22.2.1. Java EE Client Programming Model
22.2.2. Java EE Client Programming Procedures
22.2.3. Creating a Java EE Client
23. Creating SOAP Message Handler of JAX-RPC Web Service
23.1. Using SAAJ
23.1.1. Creating a SOAP Message
23.1.2. Handling an SAAJ Document
23.1.3. Sending a SOAP Message through SAAJ
23.2. Creating SOAP Message Handlers
23.2.1. Creating a Message Handler
23.2.2. Designing a Message Handler and a Handler Chain
23.2.3. Creating a Handler Interface
23.2.4. Configuring Java EE Web Services DD File
23.2.5. Using a SOAP Message Handler from the Client
23.2.6. Example of File Exchanges Between Web Services and Clients
24. Creating JAX-RPC Web Service Configuration File
24.1. Creating JAX-RPC Web Service DD File
24.2. Creating a Web Service Mapping File
24.2.1. JAX-RPC Mapping File Contents
24.2.2. Configuring JAX-RPC Mapping File
25. JAX-RPC Web Service Data Type
25.1. Overview
25.2. Java and XML Type Mapping
25.2.1. Built-in Type Mapping
25.2.2. Arrays
25.2.3. User Defined Types: JAX-RPC Value Type
25.3. Using JAX-RPC Value Type
25.3.1. Creating a Web service that Uses JAX-RPC value type
25.3.2. Creating a Web Service Client that Uses JAX-RPC Value Type
25.4. Using Holder Classes
25.4.1. Built-in Holder Classes
25.4.2. Creating a Holder Class for User Defined Types
25.5. Exceptions and SOAP Faults
25.6. Mapping MIME Type to Data Handler Type
25.6.1. Using dataHandlerOnly Option in wsdl2java
25.7. Disabling Data Binding in Doc/Literal
25.7.1. Using noDataBinding Option in wsdl2java
26. JAX-RPC Web Service Security
26.1. Overview
26.2. Transport-Level Security
26.3. Message-Level Security
26.3.1. Applying Web Service Security
26.3.2. Web Service Security Architecture
26.3.3. Configuring JEUS Web Service Security
26.3.4. Creating a Password Callback Class
26.3.5. Example of Server-side JEUS Web Service Security
26.3.6. Example of Client-side JEUS Web Service Security
26.3.7. Creating JEUS Web Service Client Using Web Service Security API
26.4. Configuring Access Control
26.4.1. Configuring Access Control Security for Java Web Services
26.4.2. Configuring Access Control for EJB Web Services
26.4.3. Invoking Web Services Configured with Basic Authentication
Glossary
Index

List of Figures

[Figure 2.1] The structure of JEUS web services
[Figure 7.1] Relationship between message contexts
[Figure 7.2] Handler Framework
[Figure 11.1] Serializing/Parsing Fast Infoset
[Figure 17.1] WS-Trust
[Figure 18.1] UDDI Data Structure & XML Tag Names
[Figure 18.2] JEUS UDDI Registry Screenshot
[Figure 18.3] UDDI Search Entry Screenshot
[Figure 18.4] UDDI Registry Search Result Screenshot
[Figure 18.5] Registered Entry
[Figure 18.6] Provider Update Screen
[Figure 18.7] Add Service Screen
[Figure 18.8] Result of Saving a TModel
[Figure 18.9] Adding a BindingTemplate
[Figure 18.10] Result of Saving a BindingTemplate
[Figure 18.11] JEUS UDDI Explorer - User Management
[Figure 18.12] JEUS UDDI Explorer - User Registration
[Figure 18.13] UDDI Subscription Flow Map
[Figure 18.14] WSDL Description & UDDI Data Structure Mapping
[Figure 18.15] WSDL published to UDDI
[Figure 23.1] Structure of SOAP with Attachment
[Figure 26.1] JEUS Web Service Security Architecture

List of Tables

[Table 10.1] JAXB 2.0 specification of xmime:expectedContentType to Java type mapping
[Table 18.1] uddi.properties
[Table 18.2] Columns in PUBLISHER table
[Table 20.1] Required Mappings: Java to MIME
[Table 25.1] Built-in XML/Java Type Mapping
[Table 25.2] Built-in Holder Class

List of Examples

[Example 3.1] << Addnumbersimpl.java >>
[Example 3.2] << build.xml >>
[Example 3.3] << AddNumbersImplService.wsdl >>
[Example 3.4] << AddNumbers.java >>
[Example 3.5] << AddNumbersResponse.java >>
[Example 3.6] << Addnumbersimpl.java >>
[Example 3.7] << build.xml >>
[Example 3.8] << AddNumbersImplService.wsdl >>
[Example 3.9] << AddNumbers.java >>
[Example 3.10] << AddNumbersResponse.java >>
[Example 3.11] << AddNumbers.wsdl >>
[Example 3.12] << build.xml >>
[Example 3.13] << AddNumbersPortType.java >>
[Example 3.14] << AddNumbers.java >>
[Example 3.15] << AddNumbersResponse.java >>
[Example 3.16] << AddNumbersImpl.java >>
[Example 4.1] << web.xml >>
[Example 4.2] << AddNumbersImpl.java >>
[Example 4.3] << AddNumbersImpl.java >>
[Example 4.4] << AddNumbersImpl.java >>
[Example 4.5] << AddNumbersImpl.java >>
[Example 4.6] << AddNumbersImpl.java >>
[Example 4.7] << AddNumbersImpl.java >>
[Example 4.8] << AddNumbersImpl.java >>
[Example 4.9] << AddNumbersImpl.java >>
[Example 4.10] << AddNumbersImpl.java >>
[Example 5.1] << http://host:port/AddNumbers/AddNumbersImplService?wsdl >>
[Example 5.2] << build.xml >>
[Example 5.3] << AddNumbersImplService.java >>
[Example 5.4] << AddNumbersImpl.java >>
[Example 5.5] << AddNumbers.java >>
[Example 5.6] << AddNumbersResponse.java >>
[Example 5.7] << AddNumbersClient.java >>
[Example 5.8] << AddNumbersClient.java >>
[Example 6.1] << custom-client.xml >>
[Example 6.2] << custom-client.xml >>
[Example 6.3] << AddNumbers.wsdl >>
[Example 6.4] << custom-client.xml >>
[Example 6.5] << custom-client.xml >>
[Example 6.6] << custom-client.xml >>
[Example 6.7] << custom-client.xml >>
[Example 6.8] << custom-client.xml >>
[Example 6.9] << custom-client.xml >>
[Example 6.10] << custom-client.xml >>
[Example 6.11] << custom-client.xml >>
[Example 6.12] << custom-client.xml >>
[Example 6.13] << custom-client.xml >>
[Example 6.14] << custom-client.xml >>
[Example 6.15] << custom-client.xml >>
[Example 6.16] << custom-client.xml >>
[Example 6.17] << custom-client.xml >>
[Example 7.1] << MyLogicalHandler.java >>
[Example 7.2] << MySOAPHandler.java >>
[Example 7.3] << MyLogicalHandler.java >>
[Example 7.4] << MyServiceImpl.java >>
[Example 7.5] << handlers.xml >>
[Example 7.6] << LoggingHandler.java >>
[Example 7.7] << handlers.xml >>
[Example 7.8] << AddNumbersImpl.java >>
[Example 7.9] << AddNumbersClient.java >>
[Example 7.10] << custom-client.xml >>
[Example 8.1] << AddnumbersImpl.java >>
[Example 8.2] << AddNumbersClient.java >>
[Example 8.3] << AddNumbersImpl.java >>
[Example 8.4] << AddNumbersClient.java >>
[Example 9.1] << custom-schema.xml >>
[Example 9.2] << build.xml >>
[Example 9.3] << AddNumbersClient.java >>
[Example 9.4] << AddNumbersClient.java >>
[Example 9.5] << AddNumbersClient.java >>
[Example 9.6] << AddNumbersImpl.java >>
[Example 9.7] << web.xml >>
[Example 10.1] << hello.wsdl >>
[Example 10.2] << hello.wsdl >>
[Example 10.3] << AttachmentApp.java >>
[Example 11.1] << AddNumbersClient.java >>
[Example 12.1] << domain.xml >>
[Example 12.2] << AddNumbersImpl.java >>
[Example 12.3] << AddNumbers.wsdl >>
[Example 12.4] << AddNumbersClient.java >>
[Example 13.1] << service-config.xml >>
[Example 14.1] << AddnumbersImpl.java >>
[Example 14.2] << AddnumbersImpl.java >>
[Example 14.3] << Addnumbers.wsdl >>
[Example 14.4] << AddNumbersImpl.java >>
[Example 15.1] << AddNumbers.wsdl >>
[Example 15.2] << service-config.xml >>
[Example 15.3] << service-config.xml >>
[Example 16.1] << AddNumbers.wsdl >>
[Example 16.2] << AddnumbersImpl.java >>
[Example 16.3] << AddNumbersClient.jsp >>
[Example 17.1] << jeus-webservices-config.xsd >>
[Example 17.2] << jeus-webservices-config.xsd >>
[Example 17.3] << jeus-webservices-config.xsd >>
[Example 17.4] << jeus-webservices-config.xsd >>
[Example 17.5] << jeus-webservices-config.xsd >>
[Example 17.6] << jeus-webservices-config.xsd >>
[Example 17.7] << jeus-webservices-config.xsd >>
[Example 17.8] << jeus-webservices-config.xsd >>
[Example 17.9] << jeus-webservices-config.xsd >>
[Example 17.10] << jeus-webservices-config.xsd >>
[Example 17.11] << jeus-webservices-config.xsd >>
[Example 17.12] << jeus-webservices-config.xsd >>
[Example 17.13] << jeus-webservices-config.xsd >>
[Example 17.14] << jeus-webservices-config.xsd >>
[Example 17.15] <<service-config.xml>>
[Example 17.16] << UsernamePasswordValidator.java >>
[Example 17.17] <<wsit-client.xml>>
[Example 17.18] << UsernamePasswordCallbackHandler.java >>
[Example 17.19] << service-config.xml >>
[Example 17.20] << wsit-client.xml >>
[Example 17.21] << service-config.xml >>
[Example 17.22] << wsit-client.xml >>
[Example 17.23] << SamlCallbackHandler.java >>
[Example 17.24] <<service-config.xml>>
[Example 17.25] <<wsit-client.xml>>
[Example 17.26] <<service-config.xml>>
[Example 17.27] WS-SecurityPolicy Setting : <<sts.wsdl>>
[Example 17.28] <<wsit-client.xml>>
[Example 17.29] << jeus-webservices-dd.xml >>
[Example 17.30] << service-config.xml >>
[Example 17.31] << jeus-webservices-dd.xml >>
[Example 17.32] << service-config.xml >>
[Example 17.33] << jeus-webservices-dd.xml >>
[Example 17.34] << service-config.xml >>
[Example 17.35] << jeus-webservices-dd.xml >>
[Example 17.36] << service-config.xml >>
[Example 17.37] << authorization.txt >>
[Example 17.38] << AddNumberClient.java >>
[Example 18.1] <<jeus-web-dd.xml>>
[Example 18.2] <<web.xml>>
[Example 19.1] << build.xml >>
[Example 19.2] << Main.java >>
[Example 19.3] << Main.java (continued) >>
[Example 19.4] << Main.java (continued) >>
[Example 19.5] << build.xml >>
[Example 19.6] << Main.java >>
[Example 19.7] << Main.java (continued) >>
[Example 20.1] << HelloIF.java >>
[Example 20.2] << Hello.java >>
[Example 20.3] << HelloHome.java >>
[Example 20.4] << HelloEJB >>
[Example 20.5] << build.xml >>
[Example 21.1] << webservices.xml >>
[Example 21.2] << jeus-webservices-dd.xml >>
[Example 21.3] << web.xml >>
[Example 21.4] << jeus-web-dd.xml >>
[Example 21.5] << application.xml >>
[Example 21.6] << service-config.xml >>
[Example 21.7] << webservices.xml >>
[Example 21.8] << jeus-webservices-dd.xml >>
[Example 21.9] << ejb-jar.xml >>
[Example 21.10] << jeus-ejb-dd.xml >>
[Example 21.11] << application.xml >>
[Example 22.1] << build.xml >>
[Example 22.2] <<ProxyClient.java>>
[Example 22.3] << DIIClient.java >>
[Example 22.4] << web.xml >>
[Example 22.5] << build.xml >>
[Example 22.6] << helloClient.jsp >>
[Example 22.7] << web.xml >>
[Example 22.8] << jeus-web-dd.xml >>
[Example 22.9] << helloClient.jsp >>
[Example 22.10] << web.xml >>
[Example 23.1] Message Handler Settings in <port-component>
[Example 23.2] << ServerAttachmentHandler.java >>
[Example 23.3] << FileTransfer.java >>
[Example 23.4] << FileTransferIF.java >>
[Example 23.5] << webservices.xml >>
[Example 23.6] << web.xml >>
[Example 23.7] << jeus-webservices-dd.xml >>
[Example 23.8] << ClientAttachmentHandler.java >>
[Example 23.9] << Client.java >>
[Example 24.1] << webservices.xml >>
[Example 24.2] DocLitEchoService : <<webservices.xml >>
[Example 24.3] DocLitEchoService : << web.xml >>
[Example 24.4] AddressBookService : <<webservices.xml >>
[Example 24.5] AddressBookService : << web.xml >>
[Example 24.6] FileAttachmentService : <<webservices.xml >>
[Example 24.7] JAX-RPC Mapping File Structure
[Example 24.8] << AddressBookService.java >>
[Example 25.1] <<Calculator.java>>
[Example 25.2] <<CalcData.java>>
[Example 25.3] <<CalculatorIF.java>>
[Example 25.4] <<CalcClient.java>>
[Example 25.5] << Calculator.java >>
[Example 25.6] << run( ) Method in CalcClient.java >>
[Example 25.7] << CalcData.java >>
[Example 25.8] << CalcDataHolder.java >>
[Example 25.9] << Calculator.java >>
[Example 26.1] <<jeus-webservices-dd.xml>>
[Example 26.2] <<jeus-web-dd.xml>>
[Example 26.3] << PWCallback.java >>
[Example 26.4] << Ping.java >>
[Example 26.5] << PingImpl.java >>
[Example 26.6] << PingPWCallback.java >>
[Example 26.7] << jeus-webservices-dd.xml >>
[Example 26.8] << pingClient.jsp >>
[Example 26.9] << jeus-web-dd.xml >>
[Example 26.10] << pingClient.jsp >>
[Example 26.11] << accounts.xml >>
[Example 26.12] << jeus-web-dd.xml >>
[Example 26.13] << web.xml >>
[Example 26.14] << accounts.xml >>
[Example 26.15] << jeus-ejb-dd.xml >>
[Example 26.16] << ejb-jar.xml >>
[Example 26.17] << jeus-webservices-dd.xml >>