Further to this problem, I attach the wsdl (both with and without debug option at compile)
and wsdd files. Weird thing is that, after re-compile and restart of TOMCAT, I now get
the order as: B A C (previously C B A), whereas I would expect A B C. This is what I have
experienced before with longer lists of arguments (i.e. order seems to be fairly arbitrary).


Any help appreciated.

*** wsdd *** (nothing special here?)

<deployment xmlns="http://xml.apache.org/axis/wsdd/";
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
<service name="checkOrder" provider="java:RPC">
<parameter name="className" value="test.CheckOrder"/>
<parameter name="methodName" value="doIt"/>
</service>
</deployment>


*** wsdl when compiling CheckOrder.java with -g (debug) option ***

<wsdl:definitions targetNamespace="http://anubis.jrc.it/axis/services/checkOrder";>
-
<wsdl:message name="doItResponse">
<wsdl:part name="doItReturn" type="xsd:string"/>
</wsdl:message>
-
<wsdl:message name="doItRequest">
<wsdl:part name="a" type="xsd:string"/>
<wsdl:part name="b" type="xsd:string"/>
<wsdl:part name="c" type="xsd:string"/>
</wsdl:message>
-
<wsdl:portType name="CheckOrder">
-
<wsdl:operation name="doIt" parameterOrder="a b c">
<wsdl:input message="impl:doItRequest" name="doItRequest"/>
<wsdl:output message="impl:doItResponse" name="doItResponse"/>
</wsdl:operation>
</wsdl:portType>
-
<wsdl:binding name="checkOrderSoapBinding" type="impl:CheckOrder">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
<wsdl:operation name="doIt">
<wsdlsoap:operation soapAction=""/>
-
<wsdl:input name="doItRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://test"; use="encoded"/>
</wsdl:input>
-
<wsdl:output name="doItResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://anubis.jrc.it/axis/services/checkOrder"; use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
-
<wsdl:service name="CheckOrderService">
-
<wsdl:port binding="impl:checkOrderSoapBinding" name="checkOrder">
<wsdlsoap:address location="http://anubis.jrc.it/axis/services/checkOrder"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


*** idem, but without -g compile option ***

<wsdl:definitions targetNamespace="http://anubis.jrc.it/axis/services/checkOrder";>
-
<wsdl:message name="doItResponse">
<wsdl:part name="doItReturn" type="xsd:string"/>
</wsdl:message>
-
<wsdl:message name="doItRequest">
<wsdl:part name="in0" type="xsd:string"/>
<wsdl:part name="in1" type="xsd:string"/>
<wsdl:part name="in2" type="xsd:string"/>
</wsdl:message>
-
<wsdl:portType name="CheckOrder">
-
<wsdl:operation name="doIt" parameterOrder="in0 in1 in2">
<wsdl:input message="impl:doItRequest" name="doItRequest"/>
<wsdl:output message="impl:doItResponse" name="doItResponse"/>
</wsdl:operation>
</wsdl:portType>
-
<wsdl:binding name="checkOrderSoapBinding" type="impl:CheckOrder">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
<wsdl:operation name="doIt">
<wsdlsoap:operation soapAction=""/>
-
<wsdl:input name="doItRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://test"; use="encoded"/>
</wsdl:input>
-
<wsdl:output name="doItResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://anubis.jrc.it/axis/services/checkOrder"; use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
-
<wsdl:service name="CheckOrderService">
-
<wsdl:port binding="impl:checkOrderSoapBinding" name="checkOrder">
<wsdlsoap:address location="http://anubis.jrc.it/axis/services/checkOrder"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


*** "this mornings" output of the servlet call to the service ***

<soapenv:Envelope>
-
<soapenv:Body>
-
<doItResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<doItReturn xsi:type="xsd:string">The correct order of the parameters is B; A; C</doItReturn>
</doItResponse>
</soapenv:Body>
</soapenv:Envelope>



Abhinav Maheshwari wrote:

Can you please post your wsdd file also ? Or you are using the jws
deployment ?

Warm regards,
Abhinav Maheshwari


-----Original Message-----
From: Guido Lemoine [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 01, 2004 8:36 PM
To: [EMAIL PROTECTED]
Subject: Parameter order in servlet call to Axis service?


Dear All,

I have defined a simple web service that takes in 3 String parameters and
processes these in a string return (CheckOrder.java). I compile with the
debug option (-g) so that the parameter names are known to the wsdl. This
works OK when called from a stand-alone SOAP client.

When I use the servlet call to the web service, with named parameters in the
FORM input fields, the order of the parameters is reversed (test.html).
Any idea why this is? If this is consistent behavior, I can work around it,
but I noticed that the parameter order is confused if used with a service
that takes in more than 10 parameters.

I am using Axis 1.1 under TOMCAT 5.0.18

Thanks,

Guido Lemoine

*** The web service ***

package test;

public class CheckOrder
{
public String doIt (String a, String b, String c) {
 String reply = "The correct order of the parameters is " + a + "; " + b +
"; " + c;
   return (reply);
}
}

*** HTML form calling the web service as a servlet ***

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us"> <title>test axis
server</title> </head> <body> <form method=GET
action="/axis/services/checkOrder">

<input type="hidden" name = "method" value = "doIt"> <table>
<tr><td>A:</td><td><input type="text" name="a" size="2" value="A"></td></tr>
<tr><td>B:</td><td><input type="text" name="b" size="2" value="B"></td></tr>
<tr><td>C:</td><td><input type="text" name="c" size="2" value="C"></td></tr>
<tr><td colspan=2 align = center><input type=SUBMIT value="Submit"></td><tr>
</table> </form> </body>


</html>

(alternatively, call directly as a URL)

http://myserver/axis/services/checkOrder?method=doIt&a=A&b=B&c=C

*** SOAP response, notice the reversal of the parameter order ***

<soapenv:Envelope>
-
 <soapenv:Body>
-
 <doItResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
-
 <doItReturn xsi:type="xsd:string">
The correct order of the parameters is C; B; A </doItReturn> </doItResponse>
</soapenv:Body> </soapenv:Envelope>





begin:vcard
fn:Guido Lemoine
n:Lemoine;Guido
org:European Commission Joint Research Centre;Institute for the Protection and Security of the Citizen
adr:;;TP 267;Ispra;VA;21020;Italy
email;internet:[EMAIL PROTECTED]
title:Scientific Project Officer
tel;work:+39 0332 786239
tel;fax:+39 0332 789658
url:http://www.jrc.cec.eu.int/
version:2.1
end:vcard

Reply via email to