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 <[EMAIL PROTECTED]> 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) <[EMAIL PROTECTED]> > 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.