I'm having trouble getting a quote back from my simple example that i've created for myself. I keep getting: "Sent 'MSFT', got 'exception'" back from the server. As you can see from my xml below in the code space, and from the getQuote documentation it appears that the namespace is not correct on Symbol and GetQuote in my request. I cant think of much else that would be wrong with this....
Basically, I want to simply get a quote back from webservicesx.net using the GetQuote Operation:
http://www.webservicex.net/stockquote.asmx?op=GetQuoteHere's what my actual (captured) xml looks like (below):
My actual code:
<code>
try {
String endpoint = "
http://www.webservicex.net/stockquote.asmx";
Service service = new Service();
Call call= (Call) service.createCall();
//call.setProperty( Call.SOAPACTION_USE_PROPER
TY, new Boolean( true ) );
// call.setProperty( Call.SOAPACTION_URI_PROPER
TY, "
http://www.webserviceX.NET/GetQuote");
call.setProperty(Call.SOAP
ACTION_USE
_PROPERTY,
new Boolean(true));
call.setProperty(Call.SOAP
ACTION_URI
_PROPERTY,
"
http://www.webserviceX.NET/GetQuote");
call.setReturnType(XMLType
.XSD_STRIN
G);
call.addParameter("symbol"
, XMLType.XSD_STRING, ParameterMode.IN);
call.setTargetEndpointAddr
ess( new java.net.URL(endpoint) );
call.setOperationName(new QName( "GetQuote") );
Object obj = call.invoke( new Object[] { "MSFT" } );
System.out.println("Sent 'MSFT', got '" + obj + "'");
} catch (Exception e) {
System.err.println(e.toStr
ing());
e.printStackTrace();
}
</code>
Thanks in advance.
Start Free Trial