/**
* This will do everything manually (ie. no WSDL).
*/
public float getQuote2(String args[]) throws Exception {
Options opts = new Options(args);
args = opts.getRemainingArgs();
if (args == null) {
System.err.println("Usage: GetQuote <symbol>");
System.exit(1);
}
/* Create default/empty Service and Call object */
/************************************************/
Service service = ServiceFactory.newInstance().createService(null);
Call call = service.createCall();
/* Strange - but allows the user to change just certain portions of */
/* the URL we're gonna use to invoke the service. Useful when you */
/* want to run it thru tcpmon (ie. put -p81 on the cmd line). */
/********************************************************************/
opts.setDefaultURL("http://localhost:8080/axis/servlet/AxisServlet");
/* Set all of the stuff that would normally come from WSDL */
/***********************************************************/
call.setTargetEndpointAddress(opts.getURL());
call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "getQuote");
call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,
"http://schemas.xmlsoap.org/soap/encoding/");
call.setOperationName(new QName("urn:xmltoday-delayed-quotes", "getQuote"));
call.addParameter("symbol", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_FLOAT);
/* Define some service specific properties */
/*******************************************/
call.setProperty(Call.USERNAME_PROPERTY, opts.getUser());
call.setProperty(Call.PASSWORD_PROPERTY, opts.getPassword());
/* Get symbol and invoke the service */
/*************************************/
Object result = call.invoke(new Object[] {symbol = args[0]});