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 "Ram Thakkalapalli (rthakkal)" <rt...@cisco.com> on 2008/02/12 11:29:29 UTC
Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
Hello,
Here is a Java API and generated WSDL snippet. Does the order of the
elements in WSDL is mandatory when constructing the SOAP envelope?
In my test setup, I have encountered that the order of the elements
seems to be mandatory? If Yes, Can we make the order optional and read
the values from element name instead of element index?
Java Class Snippet:
public stats[] retrieveCPUUtilization(String name, String timeframe )
{
return stats[];
}
WSDL snippet :
<xs:element name="retrieveCPUUtilization">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timeframe" nillable="true"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Scenario 1:
For the a SOAP request ( generated from WSDL2Java Utillity )of the
format below with the order of the paramters matching the Java API
above, the values are parsed correctly on the server side ( the java api
sets name= xy-server and timeframe=hour )
<soapenv:Body>
<retrieveCPUUtilization>
<xs:name>xy-server</xs:name>
<xs:timeframe>hour</xs:timeframe>
</retrieveCPUUtilization>
</soapenv:Body>
Scenario 2 :
For the a SOAP request ( generated using SOAPpy )of the format below
with the order of the paramters are NOT matching the Java API above, the
values are parsed INCORRECTLY on the server side( the Java API sets
name=hour, timeframe =xy-server )
<soapenv:Body>
<retrieveCPUUtilization>
<xs:timeframe>hour</xs:timeframe>
<xs:name>xy-server</xs:name>
</retrieveCPUUtilization>
</soapenv:Body>
Please let me know nif I am missing anything here.
Thanks
Ram
Re: Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
Posted by Anne Thomas Manes <at...@gmail.com>.
Your schema specifies that the element order is mandatory
(<xs:sequence>). If you want to remove that constraint, specify
<xs:all> instead. But you may encounter interoperability issues if you
do.
Anne
On Feb 12, 2008 5:29 AM, Ram Thakkalapalli (rthakkal)
<rt...@cisco.com> wrote:
>
>
> Hello,
>
> Here is a Java API and generated WSDL snippet. Does the order of the
> elements in WSDL is mandatory when constructing the SOAP envelope?
> In my test setup, I have encountered that the order of the elements seems to
> be mandatory? If Yes, Can we make the order optional and read the values
> from element name instead of element index?
>
> Java Class Snippet:
>
> public stats[] retrieveCPUUtilization(String name, String timeframe )
> {
> return stats[];
> }
>
> WSDL snippet :
> <xs:element name="retrieveCPUUtilization">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
> <xs:element minOccurs="0" name="timeframe" nillable="true"
> type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
>
> Scenario 1:
> For the a SOAP request ( generated from WSDL2Java Utillity )of the format
> below with the order of the paramters matching the Java API above, the
> values are parsed correctly on the server side ( the java api sets name=
> xy-server and timeframe=hour )
> <soapenv:Body>
> <retrieveCPUUtilization>
> <xs:name>xy-server</xs:name>
> <xs:timeframe>hour</xs:timeframe>
> </retrieveCPUUtilization>
>
> </soapenv:Body>
>
>
> Scenario 2 :
>
> For the a SOAP request ( generated using SOAPpy )of the format below with
> the order of the paramters are NOT matching the Java API above, the values
> are parsed INCORRECTLY on the server side( the Java API sets name=hour,
> timeframe =xy-server )
> <soapenv:Body>
> <retrieveCPUUtilization>
> <xs:timeframe>hour</xs:timeframe>
> <xs:name>xy-server</xs:name>
> </retrieveCPUUtilization>
>
> </soapenv:Body>
>
>
> Please let me know nif I am missing anything here.
>
> Thanks
> Ram
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
Posted by Amila Suriarachchi <am...@gmail.com>.
In a web service service specifies the contract using the wsdl and schema.
Here
*<xs:element name="retrieveCPUUtilization">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timeframe" nillable="true" type="xs:string
"/>
</xs:sequence>
</xs:complexType>
</xs:element>
*Here it has mentioned the the element order as a sequence. So the request
*must* keep the order.
thanks,
Amila.
*
*
On Feb 14, 2008 9:10 AM, Upul Godage <up...@gmail.com> wrote:
> XML Schema defines that the elements should be in that order with that
> complextype definition in the WSDL. I think, if it is not, then it is an
> error even if some tools do not care.
>
> Upul
>
>
>
> On Feb 13, 2008 6:29 AM, Ram Thakkalapalli (rthakkal) <rt...@cisco.com>
> wrote:
>
> > Should the client ensure the order of the elements inside the Soap
> > envelope?
> >
> > Ram
> >
> > ------------------------------
> > *From:* Ram Thakkalapalli (rthakkal)
> > *Sent:* Tuesday, February 12, 2008 2:29 AM
> > *To:* axis-user@ws.apache.org
> > *Subject:* Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
> >
> > Hello,
> >
> > Here is a Java API and generated WSDL snippet. Does the order of the
> > elements in WSDL is mandatory when constructing the SOAP envelope?
> > In my test setup, I have encountered that the order of the elements
> > seems to be mandatory? If Yes, Can we make the order optional and read the
> > values from element name instead of element index?
> >
> > Java Class Snippet:
> >
> > *public stats[] retrieveCPUUtilization(String name, String timeframe )*
> > *{*
> > *return stats[];
> > }*
> >
> > WSDL snippet :
> > *<xs:element name="retrieveCPUUtilization">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
> > <xs:element minOccurs="0" name="timeframe" nillable="true" type="
> > xs:string"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>*
> >
> >
> > Scenario 1:
> > For the a SOAP request ( generated from WSDL2Java Utillity )of the
> > format below with the order of the paramters matching the Java API above,
> > the values are parsed correctly on the server side ( the java api sets name=
> > xy-server and timeframe=hour )
> > *<soapenv:Body>*
> > *<retrieveCPUUtilization>*
> > *<xs:name>xy-server</xs:name>*
> > *<xs:timeframe>hour</xs:timeframe>*
> > *</retrieveCPUUtilization>*
> > *</soapenv:Body>*
> > **
> >
> > Scenario 2 :
> > For the a SOAP request ( generated using SOAPpy )of the format below
> > with the order of the paramters are NOT matching the Java API above, the
> > values are parsed INCORRECTLY on the server side( the Java API sets
> > name=hour, timeframe =xy-server )
> > *<soapenv:Body>*
> > *<retrieveCPUUtilization>*
> > *<xs:timeframe>hour</xs:timeframe>*
> > *<xs:name>xy-server</xs:name>*
> > *</retrieveCPUUtilization>*
> > *</soapenv:Body>*
> > **
> > **
> > *Please let me know nif I am missing anything here.*
> > **
> > *Thanks*
> > *Ram*
> > **
> > **
> >
>
>
--
Amila Suriarachchi,
WSO2 Inc.
Re: Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
Posted by Upul Godage <up...@gmail.com>.
XML Schema defines that the elements should be in that order with that
complextype definition in the WSDL. I think, if it is not, then it is an
error even if some tools do not care.
Upul
On Feb 13, 2008 6:29 AM, Ram Thakkalapalli (rthakkal) <rt...@cisco.com>
wrote:
> Should the client ensure the order of the elements inside the Soap
> envelope?
>
> Ram
>
> ------------------------------
> *From:* Ram Thakkalapalli (rthakkal)
> *Sent:* Tuesday, February 12, 2008 2:29 AM
> *To:* axis-user@ws.apache.org
> *Subject:* Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
>
> Hello,
>
> Here is a Java API and generated WSDL snippet. Does the order of the
> elements in WSDL is mandatory when constructing the SOAP envelope?
> In my test setup, I have encountered that the order of the elements seems
> to be mandatory? If Yes, Can we make the order optional and read the values
> from element name instead of element index?
>
> Java Class Snippet:
>
> *public stats[] retrieveCPUUtilization(String name, String timeframe )*
> *{*
> *return stats[];
> }*
>
> WSDL snippet :
> *<xs:element name="retrieveCPUUtilization">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
> <xs:element minOccurs="0" name="timeframe" nillable="true" type="xs:string
> "/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>*
>
>
> Scenario 1:
> For the a SOAP request ( generated from WSDL2Java Utillity )of the format
> below with the order of the paramters matching the Java API above, the
> values are parsed correctly on the server side ( the java api sets name=
> xy-server and timeframe=hour )
> *<soapenv:Body>*
> *<retrieveCPUUtilization>*
> *<xs:name>xy-server</xs:name>*
> *<xs:timeframe>hour</xs:timeframe>*
> *</retrieveCPUUtilization>*
> *</soapenv:Body>*
> **
>
> Scenario 2 :
> For the a SOAP request ( generated using SOAPpy )of the format below with
> the order of the paramters are NOT matching the Java API above, the values
> are parsed INCORRECTLY on the server side( the Java API sets name=hour,
> timeframe =xy-server )
> *<soapenv:Body>*
> *<retrieveCPUUtilization>*
> *<xs:timeframe>hour</xs:timeframe>*
> *<xs:name>xy-server</xs:name>*
> *</retrieveCPUUtilization>*
> *</soapenv:Body>*
> **
> **
> *Please let me know nif I am missing anything here.*
> **
> *Thanks*
> *Ram*
> **
> **
>
RE: Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
Posted by "Ram Thakkalapalli (rthakkal)" <rt...@cisco.com>.
Should the client ensure the order of the elements inside the Soap
envelope?
Ram
________________________________
From: Ram Thakkalapalli (rthakkal)
Sent: Tuesday, February 12, 2008 2:29 AM
To: axis-user@ws.apache.org
Subject: Axis2 1.3 -- Is ordering of elements madatory in SOAP BODY
Hello,
Here is a Java API and generated WSDL snippet. Does the order of the
elements in WSDL is mandatory when constructing the SOAP envelope?
In my test setup, I have encountered that the order of the elements
seems to be mandatory? If Yes, Can we make the order optional and read
the values from element name instead of element index?
Java Class Snippet:
public stats[] retrieveCPUUtilization(String name, String timeframe )
{
return stats[];
}
WSDL snippet :
<xs:element name="retrieveCPUUtilization">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timeframe" nillable="true"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Scenario 1:
For the a SOAP request ( generated from WSDL2Java Utillity )of the
format below with the order of the paramters matching the Java API
above, the values are parsed correctly on the server side ( the java api
sets name= xy-server and timeframe=hour )
<soapenv:Body>
<retrieveCPUUtilization>
<xs:name>xy-server</xs:name>
<xs:timeframe>hour</xs:timeframe>
</retrieveCPUUtilization>
</soapenv:Body>
Scenario 2 :
For the a SOAP request ( generated using SOAPpy )of the format below
with the order of the paramters are NOT matching the Java API above, the
values are parsed INCORRECTLY on the server side( the Java API sets
name=hour, timeframe =xy-server )
<soapenv:Body>
<retrieveCPUUtilization>
<xs:timeframe>hour</xs:timeframe>
<xs:name>xy-server</xs:name>
</retrieveCPUUtilization>
</soapenv:Body>
Please let me know nif I am missing anything here.
Thanks
Ram