You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Guido Lemoine <gu...@jrc.it> on 2004/06/01 09:55:29 UTC

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>



RE: Parameter order in servlet call to Axis service?

Posted by Anne Thomas Manes <an...@manes.net>.
Please send Axis-related questions to the Axis-user list.
Axis-user@ws.apache.org 

-----Original Message-----
From: Guido Lemoine [mailto:guido.lemoine@jrc.it] 
Sent: Tuesday, June 01, 2004 3:55 AM
To: soap-user@ws.apache.org
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>