You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Lars Torunski <lt...@t-online.de> on 2006/03/16 21:56:40 UTC

Axis 1.3 document literal and no parts in the message

I got stuck in a discussion between two consultants if Axis 1.3 fulfills the WSDL 1.1 specification for document/literal correctly.

Consultant 1:
Taken from http://www.w3.org/TR/wsdl#_messages (2.3 Messages) the message is defined by "Messages consist of one or more logical parts.".

Consultant 2:
On the other hand the WSDL schema definition in http://www.w3.org/TR/wsdl#A4.1 defines "wsdl:part" with <element ref="wsdl:part" minOccurs="0" maxOccurs="unbounded"/>

Consultant 1:
This maybe contradictory, but this is because WSDL may use either by "rpc" or "document" styles. Per RPC, of course, <message> may be without any <part>. Unfortunately, this is not the case with "document" style. For "document" style only the <message> <part> are sent. No other leading information is used. Thus, the inner message-parts in this case are must. One MUST NOT discard message-parts when "document" style is used.

Me:
We have a message "getAllSectors" defined as <wsdl:message name="getAllSectorsRequest">  </wsdl:message> Thus, no <part> is defined. Axis 1.3 create the following http request:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getAllSectors xmlns="urn:remote.ws.mycompany.org"/></soapenv:Body></soapenv:Envelope> 

What do you think? Is there a problem in our wsdl file or is this a bug in Axis 1.3 by using document/literal?




Re: Axis 1.3 document literal and no parts in the message

Posted by Anne Thomas Manes <at...@gmail.com>.
The WSDL 1.1 spec has a bunch of errors in it. (It's not a formal standard,
after all.) The WS-I Basic Profile clarifies these errors. See section
4.4[1] for clarifications related to messages and parts. To whit:

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
partsattribute, if the
parts attribute is specified.

Zero parts is permitted.

Assuming that your getAllSectors operation is defined as document/literal,
Axis should not insert the <getAllSectors xmlns="urn:remote.ws.mycompany.org"/>
element into the SOAP Body. The Body should be empty. Axis should insert the
method name element only if the operation is defined as rpc style.

[1] http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#WSDLMSGS

Anne

On 3/16/06, Lars Torunski <lt...@t-online.de> wrote:
>
> I got stuck in a discussion between two consultants if Axis 1.3 fulfills
> the WSDL 1.1 specification for document/literal correctly.
>
> Consultant 1:
> Taken from http://www.w3.org/TR/wsdl#_messages (2.3 Messages) the message
> is defined by "Messages consist of one or more logical parts.".
>
> Consultant 2:
> On the other hand the WSDL schema definition in
> http://www.w3.org/TR/wsdl#A4.1 defines "wsdl:part" with <element
> ref="wsdl:part" minOccurs="0" maxOccurs="unbounded"/>
>
> Consultant 1:
> This maybe contradictory, but this is because WSDL may use either by "rpc"
> or "document" styles. Per RPC, of course, <message> may be without any
> <part>. Unfortunately, this is not the case with "document" style. For
> "document" style only the <message> <part> are sent. No other leading
> information is used. Thus, the inner message-parts in this case are must.
> One MUST NOT discard message-parts when "document" style is used.
>
> Me:
> We have a message "getAllSectors" defined as <wsdl:message
> name="getAllSectorsRequest">  </wsdl:message> Thus, no <part> is defined.
> Axis 1.3 create the following http request:
>
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getAllSectors
> xmlns="urn:remote.ws.mycompany.org"/></soapenv:Body></soapenv:Envelope>
>
> What do you think? Is there a problem in our wsdl file or is this a bug in
> Axis 1.3 by using document/literal?
>
>
>
>

Axis 1.3: Difficulty generating arrays (maxoccurs = xx)

Posted by Jordan Lee <jo...@shaw.ca>.
We're seeing some odd behaviour with Axis Java class generation:

When the following complexType definition:

<xsd:complexType name="Parent">
<xsd:sequence>
			<xsd:element name="child" type="ns:Child" minOccurs="0" maxOccurs="6"/>
</xsd:sequence>
<xsd:attribute name="date" type="xsd:date" required="true"/>
</xsd:complexType>

it incorrectly generates the following:
setParent(Child[] child), leaving the user with no way to set 'date'

instead of generating setParent(Parent), with Parent having setChild(Child[] child) and setDate(Date date)

we found that the following does work:

<xsd:complexType name="Parent">
<xsd:sequence>
			<xsd:element name="child" type="ns:Child" minOccurs="0" maxOccurs="6"/>
	<xsd:element name="date" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>

Tried this with XMLBeans, which generates the correct code either way. Does anyone know anything about this?

Jordan.

Re: Axis 1.3 document literal and no parts in the message

Posted by Ju...@mro.com.
As per your WSDL (message with no parts), for doc/literal style, the
correct SOAP message should be an empty SOAP body, with no child elements.
However that being said, if this is an input message, I'm not sure if it
makes much sense to send an empty SOAP message to the server, since the
server can only dispatch based on the QName of SOAP body child element (not
sure if the server has the ability to dispatch based on an empty QName).
But if this were an output message, then it's fine to expect an empty SOAP
body, which would model a void return type from your service method.
Regardless, this does look like a bug if you are using doc/literal style.

Maybe Anne (or someone else) can comment further on this.

- Junaid



                                                                           
             Lars Torunski                                                 
             <ltorunski@t-onli                                             
             ne.de>                                                     To 
                                       axis-user@ws.apache.org             
             03/16/2006 03:56                                           cc 
             PM                                                            
                                                                   Subject 
                                       Axis 1.3 document literal and no    
             Please respond to         parts in the message                
             axis-user@ws.apac                                             
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           




I got stuck in a discussion between two consultants if Axis 1.3 fulfills
the WSDL 1.1 specification for document/literal correctly.

Consultant 1:
Taken from http://www.w3.org/TR/wsdl#_messages (2.3 Messages) the message
is defined by "Messages consist of one or more logical parts.".

Consultant 2:
On the other hand the WSDL schema definition in
http://www.w3.org/TR/wsdl#A4.1 defines "wsdl:part" with <element
ref="wsdl:part" minOccurs="0" maxOccurs="unbounded"/>

Consultant 1:
This maybe contradictory, but this is because WSDL may use either by "rpc"
or "document" styles. Per RPC, of course, <message> may be without any
<part>. Unfortunately, this is not the case with "document" style. For
"document" style only the <message> <part> are sent. No other leading
information is used. Thus, the inner message-parts in this case are must.
One MUST NOT discard message-parts when "document" style is used.

Me:
We have a message "getAllSectors" defined as <wsdl:message
name="getAllSectorsRequest">  </wsdl:message> Thus, no <part> is defined.
Axis 1.3 create the following http request:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getAllSectors
xmlns="urn:remote.ws.mycompany.org"/></soapenv:Body></soapenv:Envelope>

What do you think? Is there a problem in our wsdl file or is this a bug in
Axis 1.3 by using document/literal?