Monday, December 14, 2009

WebLogic WebServices, a quick tutorial

JAX-WS = Java API for XML-based Web Services
is replacing JAX-RPC 

it supports SOAP 1.2,
JAXB 2.1(Java Architecture for XML Binding)
attachments with MTOM 
EJB 3.0 
WS-Security WSS 1.1

A Java Web Service (JWS) contains a @WebService annotation
@WebMethod for each method

@WebParam and @WebResult

these annotations belong to the javax.jws package.

You use the jwsc Ant task to compile it

The WS is available at:

You can create a Web Service from an existing WSDL file, "the golden WSDL". Use wsdlc to generate the JWS artifacts.

A WSDL is made of:
service has a port, qualified by an address and a 
binding (soap, http) which contains a portType, specifying the input and output parameters


all these parameters are expressed in the @WebService tag

ClientGenTask is a Ant task which "generates, from an existing WSDL file, the client component files that client applications use to invoke both WebLogic and non-WebLogic Web Services"

Different styles of binding are possible:

RPC literal, RPC encoded
Document literal, Document encoded

More on how to use annotations:

Some useful tutorials:

No comments: