Try with String endpoint = "http://www.webservicex.net/stockquote.asmx<http://www.webservicex.net/stockquote.asmx?wsdl> ";
http://www.webservicex.net/stockquote.asmx is the endpoint ?wsdl is used to get the wsdl. Upul On Nov 29, 2007 9:18 AM, Clifton B. Sothoron Jr. < [EMAIL PROTECTED]> wrote: > The following is a simple java/Axis program to retrieve a stock quote. It > connects properly but all it returns is the word "exception". What is wrong > here? I'm using Axis 1.3 with Tomcat 5.5 on Windows 2003 Server. Axis > shows up properly on the Tomcat manager. > > I'm also getting the following warning at runtime. I suppose it would be > nice if the logging worked as well. All the required jar files are in the > WEB-INF/lib directory and are in the CLASSPATH. > > > > log4j:WARN No appenders could be found for logger ( > org.apache.axis.i18n.ProjectResourceBundle). > > log4j:WARN Please initialize the log4j system properly. > > > > Thanks in advance, > > Clif… > > > > import org.apache.axis.client.Call; > > import org.apache.axis.client.Service; > > import javax.xml.namespace.QName; > > import javax.xml.rpc.ParameterMode; > > import org.apache.axis.encoding.XMLType; > > > > public class StockQuote { > > public static void main(String [] args) { > > try { > > String endpoint = " > http://www.webservicex.net/stockquote.asmx?wsdl"; > > Service service = new Service(); > > Call call = (Call) service.createCall(); > > call.setTargetEndpointAddress( new java.net.URL(endpoint) ); > > call.setTimeout(30000); > > call.setSOAPActionURI("http://www.webserviceX.NET/GetQuote"); > > call.setUseSOAPAction(true); > > call.setOperationUse("literal"); > > call.setOperationName("GetQuote"); > > call.setOperationStyle("rpc"); > > call.addParameter("symbol", XMLType.XSD_STRING, > ParameterMode.IN); > > call.addParameter("GetQuoteResult", XMLType.XSD_STRING, > ParameterMode.OUT); > > String ret = (String) call.invoke("GetQuote", new Object[] {new > String("IBM")}); > > System.out.println("after invoke " + ret); > > } catch (Exception e) { > > System.err.println(e.toString()); > > e.printStackTrace(); > > } > > } > > } >
