hello
wanted to consume the following web service:
http://www.dataaccess.com/webservicesserver/numberconversion.wso
http://www.dataaccess.com/webservicesserver/numberconversion.wso?op=NumberToWords
so i used WSDL2Java to create client stubs n then followed it with a client program
public class XmethodsAccessor {
public static void main(String[] args) throws Exception{
org.apache.axis2.databinding.types.UnsignedLong x = new org.apache.axis2.databinding.types.UnsignedLong(10000L);
NumberConversionStub stub = new NumberConversionStub();
NumberConversionStub.NumberToWords request = new NumberConversionStub.NumberToWords();
request.setUbiNum(x);
NumberToWordsResponse response = stub.NumberToWords(request);
System.out.println("answer is : " + response.getNumberToWordsResult());
}
}
Upon running the program i get error
Exception in thread "main" org.apache.axis2.AxisFault: Connection reset
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:221)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
at com.dataaccess.www.webservicesserver.NumberConversionStub.NumberToWords(NumberConversionStub.java:162)
at com.dataaccess.www.webservicesserver.XmethodsAccessor.main(XmethodsAccessor.java:19)
Caused by: org.apache.axis2.AxisFault: Connection reset
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:314)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:201)
... 5 more
Caused by: org.apache.axis2.AxisFault: Connection reset
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305)
... 6 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
... 8 more
Can any one please tell me what im doin wrong and why is it not working.
Thanks
PS: am using Eclipse 3.2/Axis2 Eclipse plugin .. there were no compilation errors