hi
i have tried the following code to call the getQuote service in my localhost system , but it gives the following error. If anybody knows how to fix it plz let me know.
<code>
// Create the outgoing message
SoapObject requestObject = new SoapObject("urn
mltoday-delayed-quotes", "getQuote");
// ask for the specially encoded symbol in the included service
requestObject.addProperty("symbol", "XXX");
// use version 1.1 of soap
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
// add the outgoing object as the request
envelope.setOutputSoapObject(requestObject);
//new MarshalFloat().register(envelope); // not really needed for j2se version
// Create a transport layer for the J2SE platform. You should change this for
// another transport on midp or j2me devices.
HttpTransport transportSE = new HttpTransport("http://199.63.61.114:8086/axis/services/urn
mltoday-delayed-quotes");
// turn on debug mode if you want to see what is happening over the wire.
transportSE.debug = true;
System.out.println("Calling");
try {
// call and print out the result
System.out.println("Calling called");
transportSE.call("getQuote", envelope);
System.out.println("Calling called");
System.out.println("Env "+((Float)envelope.getResponse()).toString());
System.out.println("Res "+envelope.getResponse());
//stockQuoteTextField.setText(((Float)envelope.getRe sponse()).toString());
//stockQuoteTextField.setText(stockQuoteTextField.ge tText() + " called ");
//stockQuoteTextField = new RichTextField("gotResponse");
} catch (Exception e)
{
// if we get an error print the stacktrace and dump the response out.
//e.printStackTrace();
System.out.println(e.toString());
//System.out.println(transportSE.responseDump);
//stockQuoteTextField.setText(stockQuoteTextField.ge tText() + e);
//stockQuoteTextField = new RichTextField(transportSE.responseDump);
}
</Code>
Error:
Calling
Calling called
GME Rx Cid: IPPP
org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@689cd12b)
can anyone plz tell me the reason of this error:
SoapFault - faultcode: 'soapenv:Server.userException' faultstring: 'org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.' faultactor: 'null' detail: org.kxml2.kdom.Node@89b3290d
thanks.