Kartik,

The SOAP 1.1 spec does not specify how to handle multiple child elements in the <soap:Body>. Therefore it's unpredictable how a SOAP server will handle it.

Note that there are quite a few cases of underspecification, ambiguity, and contradiction in the SOAP 1.1 and WSDL 1.1 specifications. These specs never went through a rigorous review process in a standards organization. That's the reason why the vendors founded the WS-I organization ,and why we need the WS-I Basic Profile:
See http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html

The WS-I Basic Profile provides an unambiguous clarification on message parts:

5.3.1 Bindings and Parts

There are various interpretations about how many wsdl:part elements are permitted or required for document-literal and rpc-literal bindings and how they must be defined.

R2201 A document-literal binding in a DESCRIPTION MUST, in each of its soapbind:body element(s), have at most one part listed in the parts attribute, if the parts attribute is specified.

R2210 If a document-literal binding in a DESCRIPTION does not specify the parts attribute on a soapbind:body element, the corresponding abstract wsdl:message MUST define zero or one wsdl:parts.

R2202 A wsdl:binding in a DESCRIPTION MAY contain soapbind:body element(s) that specify that zero parts form the soap:Body.

R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute.

R2211 A MESSAGE described with an rpc-literal binding MUST NOT have the xsi:nil attribute with a value of "1" or "true" on the part accessors.

R2207 A wsdl:message in a DESCRIPTION MAY contain wsdl:parts that use the elements attribute provided those wsdl:parts are not referred to by a soapbind:body in an rpc-literal binding.

R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute.

R2208 A binding in a DESCRIPTION MAY contain soapbind:header element(s) that refer to wsdl:parts in the same wsdl:message that are referred to by its soapbind:body element(s).

Use of wsdl:message elements with zero parts is permitted in Document styles to permit operations that can send or receive messages with empty soap:Bodys. Use of wsdl:message elements with zero parts is permitted in RPC styles to permit operations that have no (zero) parameters and/or a return value.

For document-literal bindings, the Profile requires that at most one part, abstractly defined with the element attribute, be serialized into the soap:Body element.

When a wsdl:part element is defined using the type attribute, the wire representation of that part is equivalent to an implicit (XML Schema) qualification of a minOccurs attribute with the value "1", a maxOccurs attribute with the value "1" and a nillable attribute with the value "false".


At 12:10 PM 3/20/2004, you wrote:
Hi Anne,

It worked, and thanks for correcting.

Is what you said in your email about the
document/literal a standard spec?  Does it mean that
it is "unsafe" to use multipart message element (at
least for the input message)?  Why would other
web-service containers would not complain about it?  I
guess, Axis WSDL-to-Java generator should raise a
warning if it encounters a mutlipart message element.
Would you agree?

Thanks.
Kartik

--- Anne Thomas Manes <[EMAIL PROTECTED]> wrote:
> Kartik,
>
> The problem is in your WSDL message definition. When
> using
> document/literal, your message definition should
> contain only one body
> part. (You can define additional parts, but they
> should represent header
> blocks -- not separate parameters in your body.)
> Axis ignores the second part.
>
> You need to define a wrapper element for your input
> message. If you give
> that wrapper element the same name as the operation
> name, you're using the
> "wrapped" programming convention, and it will
> automatically marshal your
> parameters for you.:
>
>            <types>
>                  <schema
> targetNamespace="http://ka.apache.org/types"
>                        
> xmlns="http://www.w3.org/2001/XMLSchema"
>                        
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>
>                          <element name="foo"
> type="xsd:string" />
>                          <element name="bar"
> type="xsd:string" />
>                          <element name="wow"
> type="xsd:string" />
>                                    <element
> name="testTwo">
>                                        <complexType>
>                                          
> <sequence>
>                                              
> <element ref="xsd1:foo"/>
>                                              
> <element ref="xsd1:bar"/>
>                                           
> </sequence>
>                                      
> </complexType>
>                                   </element>
>                  </schema>
>          </types>
>
>          <message name="testTwoIn">
>                  <part name="body"
> element="xsd1:testTwo" />
>          </message>
>          <message name="testTwoOut">
>                  <part name="w" element="xsd1:wow"
> />
>          </message>
>
>
> At 04:24 PM 3/11/2004, Kartik wrote:
> >Hi Folks.
> >
> >I have attached the very simple WSDL
> (paramtest.wsdl)
> >that I am testing with.  I have a couple of issues
> and
> >it would be great if someone can point some
> >solutions/references.
> >
> >In my WSDL, I have a single operation as shown belo
> >(java mapping):
> >
> >String testTwo(String f, String b);
> >
> >The operation takes two Strings and returns the
> >"hello" back.
> >
> >I run a simple C#.NET client (I also tried IONA
> Artix
> >C++ clients with the same results) which creates a
> >proxy and calls:
> >
> >   ParamTestService service = new
> ParamTestService();
> >   string result = service.testTwo("abcd", "wxyz");
> >
> >When I try to invoke on the operation, I can see on
> >the Tomcat console, that only the first argument
> >("abcd") reaches the service.  The second argument
> >never reaches the service!  If I do a
> >System.out.println on f and b in my operation
> >implementation, I see "abcd" for f (first arg), but
> I
> >see 'null' for b (second arg)!
> >
> >Does anyone know of any such issues or if you can
> find
> >a problem in my WSDL, that would be too good.  But
> I
> >think my WSDL looks okay, because other WebService
> >tool-kits to build my service and tested the
> >interoperability (.NET (C#), Artix (C++), XMLBus
> >(Java)), the same WSDL can generate the servers and
> >clients fine with correct invocations on all
> >cross-combinations.  It seems that only Axis is
> having
> >some problems :(
> >
> >PS: I looked at the request SOAP message received
> by
> >Axis, and it DOES have the second argument's value
> -
> >but somewhere in reading the incoming message or
> >parsing it, it loses the second argument.
> >
> >Please try out the service - it will not take more
> >than 10 minutes ... See steps below:
> >
> >- Copy the WSDL to a temp location
> >- Generate the server side code:
> >java org.apache.axis.wsdl.WSDL2Java -s -a
> >paramtest.wsdl
> >- Provides a sample implementation of the
> >org/apache/ka/ParamTestImpl.java methods.
> >- Build and deploy the service on Tomcat.
> >- Generate client code using the local/deployed
> WSDL.
> >- Build and run the client to invoke the method
> >testTwo().
> >- See the SOAP messages and the behavior or the
> >service
> >
> >Thank you ...
> >Kartik
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Search - Find what you're looking for faster
> >http://search.yahoo.com<?xml version="1.0"
> encoding="UTF-8"?>
> ><definitions name="ParamTest"
> >         targetNamespace="http://ka.apache.org/"
> >         xmlns="http://schemas.xmlsoap.org/wsdl/"
> >       
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >       
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >         xmlns:tns="http://ka.apache.org/"
> >         xmlns:xsd1="http://ka.apache.org/types">
> >         <types>
> >                 <schema
> targetNamespace="http://ka.apache.org/types"
> >                       
> xmlns="http://www.w3.org/2001/XMLSchema"
> >                       
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> >
> >                         <element name="foo"
> type="xsd:string" />
> >                         <element name="bar"
> type="xsd:string" />
> >                         <element name="wow"
> type="xsd:string" />
> >                 </schema>
> >         </types>
> >
> >         <message name="testTwoIn">
> >                 <part name="f" element="xsd1:foo"
> />
> >                 <part name="b" element="xsd1:bar"
> />
> >         </message>
> >         <message name="testTwoOut">
> >                 <part name="w" element="xsd1:wow"
> />
> >         </message>
> >
> >         <portType name="ParamTestInterface">
> >                 <operation name="testTwo">
> >                         <input
> message="tns:testTwoIn" name="testTwoIn" />
> >                         <output
> message="tns:testTwoOut" name="testTwoOut" />
> >                 </operation>
> >         </portType>
> >
> >         <binding name="ParamTest"
> type="tns:ParamTestInterface">
> >                 <soap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> >
> >                 <operation name="testTwo">
> >                         <soap:operation
> soapAction="" style="document" />
> >                         <input
> message="tns:testTwoIn" name="testTwoIn">
> >                                 <soap:body
> use="literal"/>
> >                         </input>
> >                         <output
> message="tns:testTwoOut"
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

~~~~~~~~~~~~~~~~~~
Anne Thomas Manes
VP & Research Director
Burton Group

Reply via email to