TestClientpublic class TestClient extends Object
Fields Summary |
---|
public static String | msg |
Methods Summary |
---|
public static java.lang.String | doTest(java.lang.String[] args, java.lang.String op)Send a hardcoded message to the server, and print the response.
Options opts = new Options( args );
String url = opts.getURL();
String action = "EchoService" ;
if (op != null) action = op;
args = opts.getRemainingArgs();
if ( args != null ) action = args[0];
InputStream input = new ByteArrayInputStream(msg.getBytes());
Service service = new Service();
Call call = (Call) service.createCall();
SOAPEnvelope env = new SOAPEnvelope(input);
call.setTargetEndpointAddress( new URL(url) );
if (action != null) {
call.setUseSOAPAction( true );
call.setSOAPActionURI( action );
}
System.out.println( "Request:\n" + msg );
env = call.invoke( env );
System.out.println( "Response:\n" + env.toString() );
return( env.toString() );
| public static void | main(java.lang.String[] args)
doTest(args, null);
| public static void | mainWithService(java.lang.String[] args, java.lang.String service)
doTest(args, service);
|
|