scdjws5studynotes.pdf
(
3625 KB
)
Pobierz
SCDJWS 5
or nowadays know as
Oracle Certified Professional,
Java EE 5 Web Services Developer
Study Notes
by
Ivan A Krizsan
Version: December 18, 2010
Copyright 2008-2010 Ivan A Krizsan. All Rights Reserved.
1
Table of Contents
Table of Contents.................................................................................................................................. 2
Purpose .............................................................................................................................................. 10
Licensing ........................................................................................................................................... 10
Disclaimers ........................................................................................................................................ 10
Thanks................................................................................................................................................ 10
1. XML Web Service Standards.......................................................................................................... 11
1.1 XML Documents, W3C Schema and the WS-I Basic Profile 1.1............................................11
XML Documents....................................................................................................................... 11
Structure............................................................................................................................... 11
Elements............................................................................................................................... 12
Namespaces.......................................................................................................................... 13
XML Schemas........................................................................................................................... 15
The schema Element............................................................................................................ 15
Elements............................................................................................................................... 17
Complex Types..................................................................................................................... 19
Simple Types........................................................................................................................ 26
Global Attributes.................................................................................................................. 29
The anyAttribute Element.................................................................................................... 30
Anonymous Types................................................................................................................ 31
Import and Include............................................................................................................... 32
Uniqueness Constraints........................................................................................................ 33
1.2 XML Schema in Java EE Web Services.................................................................................. 34
2. SOAP 1.2 Web Service Standards.................................................................................................. 35
2.1 SOAP Message Encoding Types..............................................................................................35
Document/Literal...................................................................................................................... 37
RPC/Literal............................................................................................................................... 38
RPC/Literal vs Document/Literal Summary ............................................................................. 39
Messaging Exchange Patterns................................................................................................... 39
2.2 SOAP Processing and Extensibility Model............................................................................. 40
SOAP Processing Model........................................................................................................... 40
SOAP Nodes and SOAP Roles............................................................................................. 41
The role Attribute................................................................................................................. 41
The mustUnderstand Attribute............................................................................................. 42
Processing SOAP Messages................................................................................................. 43
Relaying SOAP Messages.................................................................................................... 44
SOAP Versioning Model...................................................................................................... 46
SOAP Extensibility Model........................................................................................................ 46
SOAP Features..................................................................................................................... 46
SOAP Message Exchange Patterns...................................................................................... 47
SOAP Modules..................................................................................................................... 47
2.3 SOAP Message Construct and SOAP Messages with Attachments........................................48
SOAP Message Elements.......................................................................................................... 48
Envelope Element.................................................................................................................48
Header Element.................................................................................................................... 48
Body Element....................................................................................................................... 49
The SOAP encodingStyle Attribute......................................................................................50
SOAP Faults.............................................................................................................................. 51
The <Code> Element........................................................................................................... 52
2
VersionMismatch Faults....................................................................................................... 53
MustUnderstand Faults.........................................................................................................54
The <Reason> Element........................................................................................................ 55
The <Node> Element........................................................................................................... 55
The <Role> Element............................................................................................................ 55
The <Detail> Element.......................................................................................................... 56
SOAP Messages with Attachments (SwA)............................................................................... 57
WS-I Basic Profile on SOAP......................................................................................................... 59
SOAP Envelopes....................................................................................................................... 59
SOAP Processing Model........................................................................................................... 60
SOAP Faults.............................................................................................................................. 61
Use of SOAP in HTTP.............................................................................................................. 62
3. Describing and Publishing (WSDL and UDDI)............................................................................. 63
3.1 WSDL in Web Services........................................................................................................... 63
Use of WSDL in Web Services................................................................................................. 63
WSDL's Basic Elements........................................................................................................... 64
The <definitions> Element................................................................................................... 69
The <import> Element......................................................................................................... 69
The <types> element............................................................................................................ 71
The <message> Element...................................................................................................... 72
The <portType> and <operation> Elements.........................................................................77
The <binding> Element........................................................................................................ 80
The <service> and <port> Elements.................................................................................... 89
WSDL Binding Mechanisms.................................................................................................... 90
Basic WSDL Operation Types.................................................................................................. 90
3.2 WSDL Abstract vs Concrete.................................................................................................... 91
3.3 WSDL Component Model....................................................................................................... 92
The Description Component..................................................................................................... 93
Element Declarations........................................................................................................... 94
Type Definitions................................................................................................................... 94
The Interface Component.......................................................................................................... 96
The Interface Fault Component............................................................................................ 98
The Interface Operation Component.................................................................................... 99
Interface Message Reference Component.......................................................................... 101
The Interface Fault Reference Component ........................................................................ 103
The Binding Component......................................................................................................... 105
The SOAP Header Block Component................................................................................ 109
The HTTP Header Component........................................................................................... 111
The Binding Fault Component........................................................................................... 113
The Binding Operation Component................................................................................... 115
The Service Component.......................................................................................................... 119
The Endpoint Component.................................................................................................. 120
3.4 UDDI Publish and Inquiry APIs............................................................................................ 122
The UDDI Inquiry API........................................................................................................... 123
Find Operations.................................................................................................................. 123
Get Operations.................................................................................................................... 123
The UDDI Publishing API...................................................................................................... 124
Authorization Operations................................................................................................... 124
Save Operations.................................................................................................................. 124
Delete Operations............................................................................................................... 125
3
Get Operations.................................................................................................................... 125
Faults....................................................................................................................................... 126
4. JAX-WS....................................................................................................................................... 127
4.1 JAX-WS Technology............................................................................................................. 127
4.2 Developing JAX-WS Web Services...................................................................................... 129
Servlet Endpoints.................................................................................................................... 130
EJB Endpoints......................................................................................................................... 130
Summary................................................................................................................................. 130
4.3 The I-Stack............................................................................................................................. 131
4.4 JAX-WS Development Approaches...................................................................................... 132
Java First................................................................................................................................. 132
WSDL First............................................................................................................................. 132
Meet in the Middle.................................................................................................................. 132
Summary................................................................................................................................. 133
4.5 JAX-WS Features.................................................................................................................. 134
Annotations............................................................................................................................. 136
Additional Features................................................................................................................. 138
AddressingFeature.............................................................................................................. 138
MTOMFeature.................................................................................................................... 138
RespectBindingFeature...................................................................................................... 138
4.6 JAX-WS Architecture............................................................................................................ 139
Client Side JAX-WS Runtime................................................................................................ 149
Server Side JAX-WS Runtime................................................................................................ 152
JAX-WS Tools SPI................................................................................................................. 153
JAX-WS Provider SPI............................................................................................................ 154
JAX-WS ServiceDelegate SPI................................................................................................ 156
4.7 Creating Web Services with JAX-WS................................................................................... 158
Requirements of a JAX-WS Endpoint.................................................................................... 158
Calculator Web Service Example (SEI).................................................................................. 159
Service Implementation Class............................................................................................ 159
Generating Web Service Artifacts...................................................................................... 162
Deploying and Running the Service................................................................................... 164
String Processor Web Service Example (Provider).................................................................166
Project Setup.......................................................................................................................166
Payloads XML Schema...................................................................................................... 166
WSDL Document............................................................................................................... 167
JAXB Beans....................................................................................................................... 168
Service Provider Class........................................................................................................169
Deploying and Running the Service................................................................................... 171
4.8 JAX-WS Client Communications Models............................................................................. 172
Synchronous Request-Response............................................................................................. 173
Asynchronous Request-Response........................................................................................... 175
Dynamic Asynchronous Invocation................................................................................... 175
Asynchronous Invocation with Proxies.............................................................................. 176
One-Way................................................................................................................................. 180
4.9 JAX-WS Web Service Clients............................................................................................... 182
Dynamic Clients...................................................................................................................... 182
Static Clients........................................................................................................................... 185
Standalone Clients...................................................................................................................186
JavaEE Clients........................................................................................................................ 187
4
4.10 Clients of Stateful Web Services.......................................................................................... 190
Example.................................................................................................................................. 190
5. REST, JSON, SOAP and XML Processing APIs (JAXP, JAXB and SAAJ)...............................196
5.1 REST Web Services............................................................................................................... 196
5.2 JSON Web Services............................................................................................................... 197
JSON Encoding Format.......................................................................................................... 197
JSON Web Services................................................................................................................ 197
5.3 SOAP vs. REST Web Services.............................................................................................. 198
5.4 SOAP vs. JSON Web Services...............................................................................................199
5.5 JAXP APIs............................................................................................................................. 200
SAX......................................................................................................................................... 200
DOM....................................................................................................................................... 201
StAX........................................................................................................................................202
XSLT....................................................................................................................................... 203
Comparing JAXP APIs............................................................................................................203
5.6 JAXB..................................................................................................................................... 204
JAXB Functions and Capabilities........................................................................................... 204
JAXB Process Flow................................................................................................................ 205
XML-to-Java...................................................................................................................... 205
Java-to-XML...................................................................................................................... 205
JAXB Binding Mechanisms....................................................................................................206
JAXB Validation Mechanisms................................................................................................ 210
5.7 SOAP Message with Attachment Using SAAJ...................................................................... 211
6. JAXR............................................................................................................................................ 222
6.1 JAXR Basics.......................................................................................................................... 222
JAXR in Web Service Architecture......................................................................................... 222
Business Registry Functionality Levels.................................................................................. 222
JAXR Business Objects.......................................................................................................... 223
6.2 JAXR Client Development.................................................................................................... 225
7. Java EE Web Services.................................................................................................................. 236
7.1 APIs Characteristics and Services..........................................................................................236
Characteristics of the Java EE Platform .................................................................................. 236
Services and APIs of the Java EE Platform............................................................................ 236
7.2 Benefits.................................................................................................................................. 237
7.3 Functions and Capabilities..................................................................................................... 238
7.4 Role of the WS-I Basic Profile.............................................................................................. 239
8. Security......................................................................................................................................... 240
8.1 Security Mechanisms............................................................................................................. 240
Transport Level Security......................................................................................................... 240
HTTP Basic Authentication................................................................................................ 240
Secure Socket Layer........................................................................................................... 240
Message Level Security.......................................................................................................... 241
XML Signature................................................................................................................... 242
XML Encryption................................................................................................................ 243
Federated Identity and Trust................................................................................................... 244
8.2 Web Services Security Initiatives and Standards................................................................... 245
8.3 JavaEE Based Web Service Security..................................................................................... 247
Setting Up for Mutual Authentication..................................................................................... 247
Enabling Client Authentication in GlassFish v2.1 and v3 ...................................................... 249
Web Tier Web Services........................................................................................................... 250
5
Plik z chomika:
freka
Inne pliki z tego folderu:
Oreilly.XMPP.The.Definitive.Guide.May.2009.pdf
(3544 KB)
Photoshop_CS4_Companion_for_Photographers.pdf
(31376 KB)
StevensUnixNetworkProgrammingVol.pdf
(12976 KB)
Open Source ESBS in Action.pdf
(8401 KB)
Open Source Journal 2011 Issue 3.pdf
(56658 KB)
Inne foldery tego chomika:
Pliki dostępne do 08.07.2024
Pliki dostępne do 19.01.2025
Andrzej Jagodzinski Trio - Christmas 1984r
Bukowski Charles
Galeria
Zgłoś jeśli
naruszono regulamin