Help. Consuming a web serrvice


XML & Web services: Help. Consuming a web serrvice

  1. Help. Consuming a web serrvice (3 messages)

    hello wanted to consume the following web service: 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( at org.apache.axis2.engine.AxisEngine.send( at org.apache.axis2.description.OutInAxisOperationClient.send( at org.apache.axis2.description.OutInAxisOperationClient.execute( at com.dataaccess.www.webservicesserver.NumberConversionStub.NumberToWords( at com.dataaccess.www.webservicesserver.XmethodsAccessor.main( Caused by: org.apache.axis2.AxisFault: Connection reset at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons( at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke( ... 5 more Caused by: org.apache.axis2.AxisFault: Connection reset at org.apache.axis2.transport.http.HTTPSender.sendViaPost( at org.apache.axis2.transport.http.HTTPSender.send( at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons( ... 6 more Caused by: Connection reset at at at at org.apache.commons.httpclient.HttpParser.readRawLine( at org.apache.commons.httpclient.HttpParser.readLine( at org.apache.commons.httpclient.HttpConnection.readLine( at org.apache.commons.httpclient.HttpMethodBase.readStatusLine( at org.apache.commons.httpclient.HttpMethodBase.readResponse( at org.apache.commons.httpclient.HttpMethodBase.execute( at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry( at org.apache.commons.httpclient.HttpMethodDirector.executeMethod( at org.apache.commons.httpclient.HttpClient.executeMethod( at org.apache.commons.httpclient.HttpClient.executeMethod( at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod( at org.apache.axis2.transport.http.HTTPSender.sendViaPost( ... 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
  2. First off, sorry for being slightly off-topic but I have no idea what your WSDL-based stub is doing. Secondly, if you realise that this web-service is actually restful you can just open http connection, make get request to appropriate URL, e.g. and get simple structure in return, like one thousand two hundred and thirty four If you do not want to poke in all that http connection plumbing and request/response processing then take a look at the client connectors from restlet framework.
  3. Hi, Since a wsdl can be consumed by any one by generating the classes needed my suggestion is to use My Eclipse to do that for u with it's web service client generator. It uses XFire which is really good. bye
  4. classes genation[ Go to top ]

    I am not sure how did you generated the classes for this web-service(WSDL). its pretty much straight forword.