cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service Invocation says "UnknownHostException"

former_member85655
Active Participant
0 Kudos

Hi,

When I run my web service with this code , I get an "Unknown Host Exception" when it is actually there..I am trying to use apache Axis. Please help and get rewarded

Here is the code

ServiceFactory serviceFactory;

serviceFactory = new ServiceFactory();

Service service = (Service)serviceFactory.createService(serviceQN);

Call call = (Call)service.createCall();

Transport t = new Transport();

t.transportName = "local";

call.setTransport(t);

call.setTargetEndpointAddress("http://www.dataaccess.com/webservicesserver/conversions.wso?WSDL");

call.setOperationName(new QName(namespace, "NumberToWords"));

call.setPortTypeName(new QName(namespace,"ConversionsSoapType"));

call.setPortName(new QName("ConversionsSoap"));

QName q =new QName("http://www.w3.org/2001/XMLSchema","unsignedLong");

call.addParameter("ubiNum",q,ParameterMode.IN);

call.setReturnType(new QName("http://www.w3.org/2001/XMLSchema","string"));

Object[] inParams = new Object[] { new UnsignedLong(1)};

System.out.println("Param Val "+call.getParameterTypeByName("ubiNum"));

String ret = (String) call.invoke(inParams);

The exception is

stackTrace:java.net.UnknownHostException: w

ww.dataaccess.com

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)

at java.net.Socket.connect(Socket.java:452)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSoc

ketFactory.java:153)

at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSoc

ketFactory.java:120)

at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:1

81)

at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.ja

va:397)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:135)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg

y.java:32)

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

If you see the details regarding Client side AXIS on this URL,

http://ws.apache.org/axis/java/client-side-axis.html

you will see that it mentions the reason for UnknownHostException as

<b>The hostname component of the URL is invalid, or the client is off-line.</b>

But I believe this could be a problem with the Internet proxy if you are using so also make sure you do the JVM settings as mentioned in the <b>Network configuration</b> part on the same URL.

former_member85655
Active Participant
0 Kudos

Thanks that worked but now there is a new problem .

The url is

http://www.dataaccess.com/webservicesserver/conversions.wso?WSDL

Error is

AxisFault

faultCode: Server.NoService

faultSubcode:

faultString: The AXIS engine could not find a target service to invoke! target

Service is null

faultActor:

faultNode:

I am calling the conversions service ,so wats wrong !

Regards,

Arun