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 calling function should clear the stack or the called function should clear the stack both have merit but its better to have one method so I don't have to keep in mind what convention is in place every time I want to call a function! In that way what if we all just agreed to use Wrapped doc/lit all the time and were done with it? Imagine how much simpler the design choices and how much better the tools and interop would be! Then we could move on from getting point to point services limping to fully distributed composite apps. </mini-rant> Jim Murphy Mindreef, Inc. Shantanu Sen wrote: > You should use the wrapped mode if you have more than > one parameter in the service end-point. Typically, > plain doc-lit should only be used if there is one > parameter in end-point. > > Can anyone comment on how the WSDL should be generated > if there are 2 parameters in a method, where one > parameter is an 'inout' parameter? I believe we should > still use 'wrapped' mode, right? > > Shantanu > > --- David Thielen <[EMAIL PROTECTED]> wrote: > >>I just tried to do doc/literal (not wrapped) with an >>add method (two int's >>in, one returned) and it failed. That has to be a >>known bug. >> >>- dave >> >> >>-----Original Message----- >>From: Shantanu Sen [mailto:[EMAIL PROTECTED] >>Sent: Monday, April 26, 2004 5:20 PM >>To: [EMAIL PROTECTED] >>Subject: RE: Have doubts about Doc/Lit with axis >> >>I think it will be a great help to all of us if you >>could file a bug with your specific test-case. >> >>I disagree with your statement that 'it appears to >>be >>totally broken'. I have successfully used doc-lit - >>both wrapped and non-wrapped - with the current axis >>src code. But clearly my test cases do not contain >>the >>stuff that is causing this bug to surface. >> >>The more bugs we find and file with specific use >>cases, the more robust the 1.2 version will be. As >>it >>has been pointed out, these guys are really doing a >>commendable job in fixing the bugs. >> >>Shantanu >> >>--- David Thielen <[EMAIL PROTECTED]> wrote: >> >>>I didn't post a bug because it appears to be >> >>totally >> >>>broken and therefore I >>>am assuming that numerous bugs have already been >>>posted. >>> >>>- dave >>> >>> >>>-----Original Message----- >>>From: Nelson Minar [mailto:[EMAIL PROTECTED] >>>Sent: Monday, April 26, 2004 12:29 PM >>>To: [EMAIL PROTECTED] >>>Subject: RE: Have doubts about Doc/Lit with axis >>> >>>David Thielen said: >>> >>>>>I tried and tried and tried to get doc/literal >> >>to >> >>>work - and finally gave >>> >>>>>up. I think it just has too many problems still. >>> >>>Joe Rattz said: >>> >>>>Dave, I had a lot of problems too, specially with >>> >>>1.2 beta, so I reverted >>> >>>>back to 1.1. I know I have seen a lot that makes >>> >>>its support of doc/lit >>> >>>>look inadequate, but once I finally got the right >>> >>>WSDL, it did work. >>> >>>Could you please, please file bug reports about >> >>the >> >>>problems you're >>>seeing? The Axis team is doing a great job of >> >>fixing >> >>>bugs as they get >>>1.2beta ready for a full 1.2 release. They're >> >>doing >> >>>free work for you! >>>All you have to do is file a meaningful problem >>>report. >>> >>>Information about filing bugs is here: >>> http://ws.apache.org/axis/bugs.html >>> >>>I've been very impressed with how fast bugs I file >>>are fixed. >>> >>> >>>PS - for what it's worth, Axis 1.2 beta is working >>>well for me with >>>document/literal wrapped services. >>> >> >> >> > >