axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <a...@manes.net>
Subject Re: wrapped services
Date Wed, 30 Jul 2003 23:07:01 GMT
RE: wrapped servicesSome further reading on "wrapped" services:

http://www.fawcette.com/javapro/2003_03/online/wsdl_kjones_03_10_03/default_
pf.asp
This article includes a sample WSDL file and sample code. It is based on
Axis 1.1 beta.

http://groups.yahoo.com/group/soapbuilders/message/7248
This is a thread from soapbuilders last year about the differences between
rpc/literal and wrapped.

In answer to specific questions, see inline delimited by <atm> ...

----- Original Message -----
From: Wendy Smoak
To: 'axis-user@ws.apache.org'
Sent: Wednesday, July 30, 2003 5:26 PM
Subject: RE: wrapped services

Anne wrote:
> If you're building a service agent in Axis, then you can use java2wsdl
> to generate the WSDL file, although there are still some bugs in this
process.
> (The design center for doc/literal assumes that you start with a WSDL
file.
> I think this is an invalid assumption, though.)
> What you should do is generate the WSDL, then tweak it so that the WSDL
> is valid, and then run wsdl2java and regen the service agent class.
Thanks!  That's what I've ending up doing... No matter how much I Java2WSDL,
I can't get
a WSDL document I can live with.  (And I'm not totally sure what it's
SUPPOSED to look like, so I'm at a distinct disadvantage here.)

<atm>
You might try using the Systinet WASP java2wsdl tool. It does a really nice
job of generating a doc/literal WSDL description from a Java class. The only
catch is that WASP includes a couple of bits in the WSDL that you don't want
to use in an Axis service (the map namespace and an ugly-looking SOAPAction
value).

I also suggest that you use a WSDL editor tool to help you verify that your
WSDL is valid -- the one's I've used are:
- Cape Clear WSDL Editor (open source)
- Omniopera (free evaluation)
- Altova XMLSpy (the best one, but also the most expensive)

I've been told that latest version of Mindreef SOAPScope also includes a
WSDL validation/editing tool that's particularly good at doc/literal. The
beta is available now.
</atm>

> If you prefer to work with Java constructs, you should use an "rpc"
provider.
> If you prefer to work with XML constructs, you should use a "message"
provider.
> Both are acceptable. One isn't "better" than the other. It depends on how
you
> want to write your service code.
Where does the "message" part go?  I see it in the WSDD (still on the Axis
Users Guide) for the MessageService class, but not in any of the WSDL
examples.  For WSDL, the choices seem to be RPC, DOCUMENT or WRAPPED.  (At
least, those are the options when using Java2WSDL.)

<atm>
So... this is really the point of all the confusion. Axis munges together
two different things called "style".
These two things are
 - The WSDL message structure style (RPC vs. Document)
 - The Axis Provider style (RPC vs. Message)

WSDL supports only two message structure styles: RPC and Document. The Axis
RPC style maps to the WSDL RPC style. The other three Axis styles (Document,
Wrapped, and Message) all map to the WSDL Document style.

Axis supports an extensible "Provider" architecture. The Provider is
responsible for handling and dispatching a message to the appropriate Web
service agent. As I mentioned in one of my previous postings today, the
details of the Provider are hidden from the client using the service,
therefore the Provider style doesn't need to be specified in the WSDL. It is
only specified in the WSDD.

Axis supplies two Providers: RPCProvider and MsgProvider. The RPCProvider
converts an XML message into Java objects and invokes a method on the
service agent. The MsgProvider just passes the XML message to the service
agent. Someone, somewhere, has also created an EJBProvider, which is very
similar to the RPCProvider, but it allows Axis to invoke an EJB component
rather than just a simple class. (When you invoke an EJB service, the
EJBProvider performs an JNDI lookup and uses the EJB Home to allocate an
instance of the EJB component.) If you wanted to, you could build other
Providers to enable access via JNI, JCA, JDBC, JMS, or pretty much any
interface you can think of.

But back to the basics -- Axis provides two providers. The Axis RPC,
Document, and Wrapped styles all map to the RPCProvider. The Axis Message
style maps to the MsgProvider.

It doesn't make sense to use java2wsdl when using message style services.
java2wsdl generates a message structure based on a Java interface. But
that's not what you want to do with a message style service. So, the only
place you specify the "message" style is in the WSDD:
   <service ... style="message">
This option tells Axis to handle requests to this service using the
MsgProvider rather than the RPCProvider.
</atm>


--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM


Mime
View raw message