Hi,
I have a simple .NET webservice that has 2 methods. Both methods return
a string but one takes an integer and the other takes a string.
I have written a apache soap client to access the service.
When i try to invoke the method that takes int, it works fine. BUT it
does not for the method that takes the string.
Is it a problem with the serializers? This is the fault i receive:
Fault Code = soap:Server
Fault String = Server was unable to process request. --> Object
reference not set to an instance of an object.
Could someone please help !
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
This is the code for it
import org.apache.soap.encoding.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.rpc.*;
import org.apache.soap.*;
import java.util.*;
import java.net.*;
class RMT {
static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
static String __targetNS = "http://tempuri.org/";
static String __methNsURI = __targetNS;
static String __baseURL = "http://160.39.201.12/Simple/simple.asmx";
static String __soapAction = "http://tempuri.org/SimpleInput";
static String __methodName = "SimpleInput";
// static String __methodName = "SimpleMethod";
// static String __soapAction = "http://tempuri.org/SimpleMethod";
public static void main(String args[]) throws Exception {
Call call = new Call();
SOAPMappingRegistry smr = new SOAPMappingRegistry();
StringDeserializer mySer = new StringDeserializer();
smr.mapTypes(XMLSOAP, new QName(__targetNS, "SimpleInputResult"),
String.class, null, mySer);
call.setSOAPMappingRegistry(smr);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI(__methNsURI);
call.setMethodName(__methodName);
Vector params = new Vector();
params.addElement(new Parameter("strInput", String.class, "Test",
null));
// params.addElement(new Parameter("intInput", int.class, new
Integer(555), null));
call.setParams(params);
URL url = new URL(__baseURL);
Response res = call.invoke(url, __soapAction);
if (res.generatedFault()) {
Fault f = res.getFault();
System.out.println("Fault Code = " + f.getFaultCode());
System.out.println("Fault String = " + f.getFaultString());
} else {
Parameter p = res.getReturnValue();
System.out.println(" Object Value = " + p.getValue());
}
}
}
~Alpa
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>