}
String namespace = "urn:xmltoday-delayed-quotes";
symbol = args[0] ;
ServiceClient call = new ServiceClient(opts.getURL());
call.setTransport(new TCPTransport());
ServiceDescription sd = new ServiceDescription("stockQuotes", true);
sd.addInputParam("symbol", SOAPTypeMappingRegistry.XSD_STRING);
sd.setOutputType(SOAPTypeMappingRegistry.XSD_FLOAT);
call.setServiceDescription(sd);
// TESTING HACK BY ROBJ
if (symbol.equals("XXX_noaction")) {
symbol = "XXX";
call.set(HTTPConstants.MC_HTTP_SOAPACTION, "");
}
call.set( Transport.USER, opts.getUser() );
call.set( Transport.PASSWORD, opts.getPassword() );
// useful option for profiling - perhaps we should remove before
// shipping?
String countOption = opts.isValueSet('c');
int count=1;
if ( countOption != null) {
count=Integer.valueOf(countOption).intValue();
System.out.println("Iterating " + count + " times");
}
Float res = new Float(0.0F);
for (int i=0; i<count; i++) {
Object ret = call.invoke(
namespace, "getQuote", new Object[] {symbol} );
if (ret instanceof String) {
System.out.println("Received problem response from server: "+ret);
throw new AxisFault("", (String)ret, null, null);
}