Java2WSDL implies that you are modeling the documents being exchanged by
your document/literal SOAP web service as Java objects, or in other words
Java types.

Given that W3C XML Schema is not an object oriented type system, you are
then required to trust your "Java2WSDL GUI" (BEA Weblogic Workshop, for
example) to map your language specific object oriented types to W3C XML
Schema types.  The tool is literally generating the WSDL+XSD.  A
SOAP/WSDL/XML purist might not be willing to let an OO data modeling tool
produce the XML type system and SOAP message exchange patterns documented in
the WSDL+XSD.  Most of the time they want more control over the XML type <->
OO type mapping process - and arguably so.  If I'm building a web service
that does XML document oriented messaging over SOAP - shouldn't I be
primarily concerned about the XML document data models?

Which is why the SOAP/WSDL/XML purists are all modeling their W3C XML
Schemas first, then their WSDL, and then figuring out how to implement a
SOAP service that complies to that WSDL using an object oriented programming
language.  A SOAP platform specific WSDL2Java utility is sometimes the
solution, sometimes not.

W3C XML Schema <-> Java data binding is standardized in the JAXB
specification, but some people don't like JAXB.  They prefer other mapping
APIs/toolkits like Castor.  Complicating this issue is that currently,
JAX-RPC 1.1 does not govern W3C XML Schema <-> Java data binding issues -
JAX-RPC 2.0 is being tied to JAXB 2.0.  Time will tell if this helps to
alleviate any of these problems.

Axis WSDL2Java and Java2WSDL assume the use of the underlying Axis W3C XML
Schema <-> Java data binding engine, and lots of people just sidestep the
data binding engine altogether by using Axis "message style" services, a la:

public Document myOperation (Document requestDocument) {}

Realize that when you are comparing Java based SOAP platforms and toolkits
it may be that you are comparing apples to apples - but a Macintosh apple
tastes very different than a Granny Smith, and each may be suited for
different types of recipes.  :)

Regards,
Jonathan Anderson
Booz Allen Hamilton

-----Original Message-----
From: Shantanu Sen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 27, 2004 2:46 PM
To: [EMAIL PROTECTED]
Subject: RE: Have doubts about Doc/Lit with axis


That may be a good enhancement request, but Java2WSDL
gives you more flexbility in the sense that you can
specify doc/lit or wrapped based on your need. So it
assumes that you know what you need.

I was playing with BEA WebLogic 8.1 workshop and when
I  create a method and choose to expose it as a web
service and choose the soap-style as document, it
always generates the WSDL in the wrapped mode. I am
not sure what the WASP developer toolkit does. But it
seems that wrapped mode is becoming standard because
probably most toolkits think that it is the best bet
for interoperability.

When you are using a command line utility you have
more options, so it is upto you to specify whether you
want doc/lit or wrapped. I feel it is the
responsibility of a tool higher up e.g. a GUI tool
which uses Java2WSDL, to warn the user that they
should use wrapped if the number of params > 1. But
there may be differing opinions on this.

Shantanu

--- "Yakulis, Ross (Ross)" <[EMAIL PROTECTED]> wrote:
> Okay that is all fine and well.  And in general I
> agree.
> But if you are using Java2WDSL and not hand writing
> these ugly wsdl files, the "tool"(Java2WSDL) should
> say something
> to the effect that your java source file
> (class/interface) is
> not suitable for the chosen style and that WRAPPED
> or RPC might be
> a preferable way to generate the wsdl file, and not
> out put an obscure
> message that leaves one wondering what the heck went
> wrong.
>
> All David did in his original try was to use a
> simple java class an
> what appeared to be the proper tool Java2WSDL.  A
> good error message would
> have suggested to him to use wrapped and then he
> could have changed
> the -y and -u options and he would have been a happy
> camper.
>
>
> Ross
>
> -----Original Message-----
> From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 27, 2004 10:31 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Have doubts about Doc/Lit with axis
>
>
> For the most part, I concur with Jim. If you want to
> create an RMI-style
> programming interface, always use wrapped/literal.
> On the other hand, if you
> want to send a predefined schema (such as a standard
> schema defined by your
> favorite vertical industry group), you may need to
> use Document/Literal --
> particularly if the schema contains attributes.
> Wrapped/Literal simulates
> the RPC style, and it doesn't permit attributes.
>
> Just to be clear, I don't believe that Axis is all
> that buggy when it comes
> to wrapped/literal. Certainly lots of folks have
> been able to get it to
> work. If there are bugs, then I think they're fairly
> obscure (only occur
> with unusual structures, etc). If you do find bugs,
> then please report them.
>
> I think a lot of the so-called "bugs" that people
> are finding may in fact be
> user error.
>
> When using either wrapped or document literal, there
> is at most one body
> part for input and at most one body part for output.
> You do *not* define the
> individual parameters as separate parts in your
> message definition.
>
> But that doesn't mean that you can't use wrapped
> style if you have more than
> one argument -- you can.
>
> You must define your input and output parameters as
> element structures in
> the <types> section. From David's description, it
> sounds like he tried to
> define a doc/literal service specifying two input
> parts and one output part,
> and this won't work. *It's not supposed to.*
>
> What follows is a WSDL that defines a simple add
> operation that takes two
> ints in and returns an int using Wrapped/Literal.
> This WSDL permits you to
> invoke the service like this:
>
>          int result = addProxy.add( "1", "2" );
>
> This WSDL demonstrates the Wrapped programming
> convention. Notice that the
> portType defines an operation called "add". It takes
> the "addRequest"
> message in and returns the "addResponse" message
> out. The "addRequest"
> message has one body part called "parameters" (in
> Axis this name is not
> important, but .NET requires this name for Wrapped
> style). It references an
> element called "add". The name of this input element
> must be the same as the
> operation name. The "add" element is defined as a
> complex type that is a
> sequence of two elements (the input parameters),
> "arg1" and "arg2", which
> are both defined as ints. This complex type must be
> defined as a sequence of
> elements.
>
> <?xml version='1.0'?>
> <wsdl:definitions name='addWrappedLiteral'
>     targetNamespace='urn:add'
>
> xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
>     xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
>     xmlns:types='urn:add/types'
>     xmlns:intf='urn:add'>
>
>   <wsdl:types>
>     <xsd:schema elementFormDefault="qualified"
>         targetNamespace='urn:add/types'
>
> xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
>       <xsd:element name="add" type="types:add_t"/>
>       <xsd:element name="result" type="xsd:int"/>
>       <xsd:complexType name="add_t">
>         <sequence>
>           <xsd:element name="arg1" type="xsd:int"/>
>           <xsd:element name="arg2" type="xsd:int"/>
>         </sequence>
>       </complexType>
>     </xsd:schema>
>   </wsdl:types>
>
>   <wsdl:message name='addRequest'>
>     <wsdl:part name='parameters'
> element='types:add'/>
>   </wsdl:message>
>   <wsdl:message name='addResponse'>
>     <wsdl:part name='parameters'
> element='types:result'/>
>   </wsdl:message>
>
>   <wsdl:portType name='addPT'>
>     <wsdl:operation name='add'>
>       <wsdl:input message='intf:addRequest'/>
>       <wsdl:output message='intf:addResponse'/>
>     </wsdl:operation>
>   </wsdl:portType>
>
>   <wsdl:binding name='addSoapBinding'
> type='intf:addPT'>
>     <soap:binding
>
> transport='http://schemas.xmlsoap.org/soap/http'
>        style='document'/>
>     <wsdl:operation name='add'>
>       <soap:operation soapAction='urn:add'/>
>       <wsdl:input>
>         <soap:body use='literal'/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use='literal'/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>
>   <wsdl:service name='addService'>
>     <wsdl:port name='addSoapPort'
> binding='intf:addSoapBinding'>
>       <soap:address location='...'/>
>     </wsdl:port>
>   </wsdl:service>
>
> </wsdl:definitions>
>
> Regards,
> Anne
>
> -----Original Message-----
> From: Jim Murphy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 27, 2004 9:44 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Have doubts about Doc/Lit with axis
>
> Shantanu,
>
> In doc/lit there is no spoon - er - I mean there is
> no notion of inout,
> in, out or whatever.  Those are entirely rpc
> concepts and have no
> bearing in doc/lit (wrapped or otherwise).
>
> Plenty of folks differ on this - which is why even
> at this point interop
> and tools still blow - but there is a camp that feel
> that wrapped should
> be the way you do everything.  That might be
> overstating it a bit but it
> should be the default/common practice.
>
> <mini-rant>
> This is all just like the various function calling
> conventions of C,
> C++, Java, FORTRAN, MSIL etc.  Debate over whether
> the
=== message truncated ===

Reply via email to