• Post Reply Bookmark Topic Watch Topic
  • New Topic

This is not cool... Anyone know why?

 
Ariel Valentin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Evening Everyone,
Having trouble understanding why the following is happening:
Here is the method signature of the web service I am trying to invoke
public String checkInventory(String productId, Integer quantity);
When I deploy the web service this is how the wsdl describes the method parameters:
http://localhost:8080/axis/services/com.university.ws.InventoryCheck?wsdl
Yeilds:

I am sending an order for 2000 of item bk0001 in0=2000&in1=bk0001 and it should return false:
But it fails when I send the parameters as in0=bk0001&in1=2000:
http://localhost:8080/axis/services/com.university.ws.InventoryCheck?method=checkInventory&;in0=bk0001&in1=2000

Yet it works this way http://localhost:8080/axis/services/com.university.ws.InventoryCheck?method=checkInventory&;in0=2000&in1=bk0001
Returns:

What is interesting is that it works when I create an Object [] with String[0] Integer[1] pass it to the invoke method of the Call class.
Anyone know why?
-Tomcat 4.1.24 -J2SDK/JRE 1.4.2-Axis 1.1-Win XP
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't it be "in1=2000&in0=bk0001" instead of "in0=2000&in1=bk0001"?
I mean if the WSDL specifies "in0" to be a string and "in1" to be an integer, that's what the web service engine expects...
[ March 09, 2004: Message edited by: Lasse Koskela ]
 
Ariel Valentin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is exactly the problem it fails when I send the parameters as in0=String in1=Integer
in0=bk0001&in1=2000
<a href="http://localhost:8080/axis/services/com.university.ws.InventoryCheck?method=checkInventory&<b rel="nofollow">in0=bk0001&in1=2000</b>" target="_blank">http://localhost:8080/axis/services/com.university.ws.InventoryCheck?method=checkInventory&in0=bk0001&in1=2000
<faultcode>soapenv:Server.userException</faultcode> <faultstring>java.lang.NumberFormatException: For input string: "bk0001"</faultstring>
It works if I use clientObject.invoke(new Object[]{"bk0001", Integer.valueOf(2000) } )

By the why, sorry about those crazy Graemlins forget to disable them.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!