Apache CXF Web Service Development

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Naveen Balani, Rajeev Hathi
Publisher: Packt Publishing
Year: 2009

Language: English
Pages: 335

Wow! eBook......Page 0
Copyright......Page 2
Credits......Page 3
About the Authors......Page 4
About the Reviewer......Page 6
Table of Contents......Page 7
Preface......Page 13
Getting Familiar with CXF......Page 19
XML......Page 20
SOAP (Simple Object Access Protocol)......Page 21
WSDL (Web Services Description language)......Page 22
REST (Representational State Transfer)......Page 24
Introducing web services......Page 25
Approaches for web service development......Page 26
Web service SOAP communication styles......Page 27
History of CXF......Page 28
Support for web service standards......Page 29
Frontend programming APIs......Page 30
Support for RESTful services......Page 31
Ease of use......Page 32
For ANT users......Page 33
For Maven users......Page 34
Summary......Page 36
Developing a Web Service with CXF......Page 37
The Order Processing Application......Page 38
Creating a Service Endpoint Interface (SEI)......Page 39
Developing a service implementation class......Page 42
Spring-based server bean......Page 43
Developing a client......Page 44
Developing web service client code......Page 45
Running the program......Page 48
Building the code......Page 49
Executing the code......Page 50
Bus......Page 51
JAX-WS......Page 53
Messaging and Interceptors......Page 55
Service model......Page 57
Data binding......Page 58
Protocol binding......Page 59
Summary......Page 61
JAX-WS frontend......Page 63
Code-first development......Page 64
Creating Service Endpoint Interface (SEI)......Page 65
Adding Java annotations......Page 66
Publishing the service......Page 71
Developing a consumer......Page 72
Running the Code-first example......Page 73
Contract-first development......Page 74
Generating service components......Page 76
Publishing the web service......Page 85
Creating a simple dynamic client......Page 86
Running the dynamic client......Page 88
Using the CXF service model for building dynamic client......Page 89
Running the dynamic client which uses Service Model API......Page 92
Provider and Dispatch services......Page 93
Message mode......Page 94
javax.xml.transform.Source......Page 95
Implementing Provider service......Page 97
Publishing the Provider service......Page 100
Implementing the Dispatch service......Page 101
Running the provider dispatch example......Page 103
Web service context......Page 105
Implementing Context in service......Page 106
Running the web service context example......Page 107
Developing a simple frontend......Page 108
Creating server implementation......Page 109
Creating client......Page 110
Running the simple frontend example......Page 111
Summary......Page 112
Learning about Service Transports......Page 113
HTTP transport......Page 114
SOAP over HTTP......Page 115
HTTP only......Page 117
HTTP Conduit......Page 118
HTTP destination......Page 119
HTTPs transport......Page 120
Generating crypto key......Page 121
Creating client and server bean configuration......Page 122
Developing the client component......Page 125
Building and deploying......Page 126
Configuring SSL for Jetty runtime......Page 127
JMS transport......Page 130
Developing an embedded broker......Page 131
Creating a server and client bean configuration......Page 132
Developing a client component......Page 134
Performing build and deployment......Page 135
Local transport......Page 138
Creating client bean configuration......Page 139
Developing a Client......Page 140
Building and executing......Page 141
Summary......Page 142
Understanding CXF interceptors......Page 143
Understanding interceptor phase and chain......Page 144
Overview of the interceptor API......Page 145
The PhaseInterceptor interface......Page 146
The AbstractPhaseInterceptor class......Page 147
Developing the custom interceptor......Page 149
Developing the server side interceptor......Page 150
Developing the client side interceptor......Page 153
Adding a client side interceptor to the client code......Page 156
Developing the standalone server for publishing the Order Process web service......Page 157
Building and running the Order Process web service and interceptor......Page 158
Building the code......Page 159
Executing the code......Page 160
Testing the custom interceptor for negative condition......Page 161
Understanding CXF features......Page 163
Developing service and implementation class......Page 164
Developing a server component......Page 165
Creating the client bean configuration file......Page 166
Building and executing the code......Page 167
Overview of Invoker API......Page 169
The AbstractInvoker class......Page 170
Developing custom invoker......Page 171
Summary......Page 176
Developing RESTful Services with CXF......Page 177
Overview of REST and RESTful services......Page 178
Java API for RESTful services......Page 180
CXF JAX-RS implementation......Page 182
Developing end-to-end RESTful services using CXF JAX-RS implementation......Page 183
Creating Java data objects for Request and Response......Page 184
Providing binding for the Request and Response data objects......Page 186
Developing the implementation class......Page 187
Creating the client......Page 197
Running the program......Page 201
Building the code......Page 202
Deploying the code......Page 203
Executing the code......Page 204
Adding exception handling to RESTful service......Page 206
Summary......Page 211
Deploying RESTful Services with CXF......Page 213
Configuring CategoryService RESTful bean using Spring......Page 214
Integrating Spring using web.xml......Page 216
Building the code......Page 217
Deploying the code......Page 219
Installing POSTER client......Page 220
Invoking the Get Category operation......Page 222
Invoking the Add Category operation......Page 224
Invoking the Update Category operation......Page 226
Invoking the Add Books operation......Page 228
Invoking the Get Books operation......Page 230
Invoking the Update Category operation with
invalid request......Page 232
Invoking the Get Category operation with invalid request......Page 234
Invoking the Delete Category operation......Page 236
Invoking the Book Shop application using CXF APIs......Page 237
Configuring JSON support for the Book Shop application......Page 242
Incorporating JSON message format for
the Book Shop application......Page 243
Invoking the Get Category operation with JSON as the message format......Page 246
Invoking the Add Category operation with JSON
as the message format......Page 248
Invoking the Book Shop application with JSON as the message format using CXF APIs......Page 250
Intercepting messages for the Book Shop application......Page 252
Summary......Page 255
Invoking a web service using the
Java client......Page 257
Analyzing the service WSDL definition......Page 258
Generate the web service clients......Page 263
Analyzing the JAX-WS and client generated artifacts......Page 267
Modifying the generated client......Page 268
Running the client......Page 270
Invoking the web service using
JavaScript......Page 271
Generating the JavaScript client......Page 272
Analyzing the generated artifacts......Page 274
Creating the client......Page 278
Running the client......Page 282
Creating Service Implementation from the WSDL file......Page 283
Generating the web Service Implementation......Page 284
Analyzing the Service Implementation generated artifacts......Page 285
Modifying the generated Service Implementation......Page 286
Deploying and publishing the web service......Page 289
Invoking the web service......Page 290
Validating WSDL files......Page 291
Summary......Page 292
Downloading the source code......Page 293
Downloading the software required for the book......Page 294
Setting up the environment......Page 295
Using Maven for Build management......Page 296
Building chapter source code using Maven......Page 297
Getting Started with Spring......Page 301
Understanding Inversion of Control......Page 302
Overview of aspect-oriented
programming......Page 304
The Spring IoC container......Page 305
Creating the entity model......Page 306
Creating services......Page 310
Creating the application and wiring POJO......Page 312
Creating the standalone client......Page 316
Running the program......Page 318
Building the code......Page 319
Executing the code......Page 321
Summary......Page 322
Index......Page 323