following is the code i am using for calling the deployed service.
// Create SOAP RPC Call Object
Call call = new Call ( );
// Set Encoding Style to standard SOAP encoding
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
// Set Object URI and Method Name
call.setTargetObjectURI ("urn:examples:helloservice");
call.setMethodName ("sayGreeting");
// Set Method Parameters
Parameter param = new Parameter("name", String.class,
firstName, Constants.NS_URI_SOAP_ENC);
Vector paramList = new Vector ( );
paramList.addElement (param);
call.setParams (paramList);
// Set the URL for the Web Service
URL url = new URL ("http://localhost:8070/soap/servlet/rpcrouter");
// Invoke the Service
Response resp = call.invoke (url, "");
// Check for Faults
if (!resp.generatedFault( )) {
// Extract Return value
Parameter result = resp.getReturnValue ( );
String greeting = (String) result.getValue( );
return greeting;
}
else {
// Extract Fault Code and String
Fault f = resp.getFault( );
String faultCode = f.getFaultCode( );
String faultString = f.getFaultString( );
System.err.println("Fault Occurred (details follow):");
System.err.println("Fault Code: "+faultCode);
System.err.println("Fault String: "+faultString);
return new String ("Fault Occurred. No greeting for you!");
}
there is a service deployed with urn "urn:examples:helloservice"