views:

429

answers:

1

i can't seem to figure what i'm doing wrong. i am simply trying to call a .net web service method from my BB application. when i call a method that DOES NOT require parameters, i get a valid string response and everyone is happy. however, when i call a method that requires parameters (and i pass those parameters within the invoke() call), i get the same null response (default values for a string and integer).

the .net method that i am calling will simply return the values i passed to it. so if i call the method "TestMe" with parm1 = "hello" and parm2 = "123", the response i should get is Hello. Received ----> [parm1] hello [int1] 123. i can verify this response by simply calling the method through the WSDL via firefox.

when i attempt to call the same method through the invoke() call, i get [parm1] [int1]0.

to me, it seems that the .net method is not receiving any parameter values and is simply returning the default values for a string and integer types. so, is there something that i need to change to the .net web service to get a valid response or do i need to add something else to the java code (for my BB app)?

I am using eclipse as the editor, jdk1.16.0_017 as the JRE

import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.client.Service;

String endpoint = "http://[SERVER]/wsBB/clsMyFunctions.asmx?WSDL";
String methodName = "TestMe";
String actionURI = "http://www.blahblahblah.com/TestMe";

 // set a SOAP call
 try {
   Service service = new Service();
   Call call = (Call) service.createCall();
   call.setTargetEndpointAddress( new java.net.URL( endpoint ) );
   call.setUseSOAPAction(true);
   call.setSOAPActionURI(actionURI);            
   call.setOperation(methodName);
   String ret = (String) call.invoke( new Object[]{"Hello!","1234"} );

   System.out.println("Sent 'Hellooooooooooo!', got '" + ret + "'"); 
 }
 catch( AxisFault af ) {
   System.out.println("dump: "+ af.dumpToString());
 }
 catch(Exception e)
 {
  System.out.println("EXCPETION: "+ e.toString());
 }
+1  A: 

Assuming you're in control of the web service, I strongly recommend that you use Wireshark (or something similar) to see what the request and response look like - and what they're like when you try the same thing from a browser, or from another web service client.

That way you should get some indication of whether the problem is with the request or the response, and the nature of that problem.

I'd also try the same code from a simple Java console app - get it working there before getting the Blackberry involved.

Jon Skeet
Unfortunately, i am unable to download anything or install anything to our servers. we are TOTALLY blocked from downloading anything and i don't have admin rights to any of the boxes.
sexitrainer
Also, i am testing this in a simple main class. is this something having to do with SoapRpc and i just need to get away from this?
sexitrainer
Can you not try this on your development boxes?
Jon Skeet
yes....all my coding is done on a development box.
sexitrainer
@sexitrainer: So run Wireshark on your development box, and you can still see what's going on. Or are you prevented from even installing software on your dev box?
Jon Skeet
@johnskeet: YES !!!! that's my dilemma. i have access to the box, but i do NOT have permission to install anything on it. of course, i probably ask someone (with authority) to install wireshark on the dev box, but that will be unlikely since any type of installation has to go through a review committee and a bunch of red tape. now you see my dilemma.
sexitrainer
@sexitrainer: Is this a public-facing server? Could you try the same thing from home, on a machine you *do* have control over?
Jon Skeet