aspose file tools*
The moose likes Web Services and the fly likes Error while invoking Webservice  Unable to sendViaPost to url---java.net.UnknownHostException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Error while invoking Webservice  Unable to sendViaPost to url---java.net.UnknownHostException" Watch "Error while invoking Webservice  Unable to sendViaPost to url---java.net.UnknownHostException" New topic
Author

Error while invoking Webservice Unable to sendViaPost to url---java.net.UnknownHostException

Sandesh Thammaiah
Greenhorn

Joined: Jul 26, 2012
Posts: 1
Hi All,

I am very new to web service i gone through few of the tutorials and created local web service and invoked it its working fine.Now that i want to invoke remote web service i am getting below mentioned exception

Unable to sendViaPost to url[http://www.webservicex.net/stockquote.asmx]
java.net.UnknownHostException: www.webservicex.net
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:239)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
at java.lang.Thread.run(Thread.java:619)
org.apache.axis2.AxisFault: www.webservicex.net
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at net.webservicex.www.StockQuoteStub.getQuote(StockQuoteStub.java:192)
at net.webservicex.www.Test.main(Test.java:28)
Caused by: java.net.UnknownHostException: www.webservicex.net
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:239)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
at java.lang.Thread.run(Thread.java:619)

If proxy is the issue can any one suggest me how do i configure it.Thanks in advance
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

Are you able to access the URL http://www.webservicex.net/stockquote.asmx directly from the browser?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while invoking Webservice Unable to sendViaPost to url---java.net.UnknownHostException