String[] symbols = new String[numArgs];
for (int i = 0; i < numArgs; i++) {
symbols[i] = args[i];
}
Service service = new Service(new XMLStringProvider(wsdd));
HashMap cfProps = new HashMap();
cfProps.put(SonicConstants.BROKER_URL, opts.isValueSet('b'));
cfProps.put(SonicConstants.DEFAULT_USERNAME, opts.getUser());
cfProps.put(SonicConstants.DEFAULT_PASSWORD, opts.getPassword());
// do we have a jndi name?
String jndiName = opts.isValueSet('n');
if (jndiName != null) {
// w/ a jndi name, we can get the appropriate connection factory
cfProps.put(JMSConstants.CONNECTION_FACTORY_JNDI_NAME, jndiName);
} else {
// w/o a jndi name, we default to using the Sonic-specific method
// for creating a connection factory, which is by specifying the
// appropriate connection factory class from SonicConstants.java
// topics or queues?
String cf = null;
if (opts.isFlagSet('t') > 0) {
cf = SonicConstants.TCF_CLASS;
} else {
cf = SonicConstants.QCF_CLASS;
}
cfProps.put(JMSConstants.CONNECTION_FACTORY_CLASS, cf);
}
// create the transport
JMSTransport transport = new JMSTransport(null, cfProps);
// create a new Call object
Call call = (Call) service.createCall();
call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_FLOAT );
call.setTransport(transport);