tags:

views:

1421

answers:

4

I am using apache axis to connect my java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:

org.apache.axis.ConfigurationException: No service named is available

any idea?

A: 

This question is really difficult to answer without the wsdl and your client code available.

jsight
A: 

This is what my code looks like. It seems to work fine. Are you using a service locator or just creating your service?

SomeServiceLocator locator = new SomeServiceLocator();
SomeService service = null;
try
{
    service = locator.getSomeServiceImplPort();
}
catch (ServiceException e)
{
    e.printStackTrace();
}
ScArcher2
+2  A: 

Just a guess, but it looks like that error message is reporting that you've left the service name blank. I imagine the code that generates that error message looks like this:

throw new ConfigurationException("No service named" + serviceName + " is available");
KC Baltz
A: 

I don't know what version of Axis you're using but I'm using Axis2 for both server and client and the Java2WSDL create a default endpoint for the service on localhost. If you create the client stub with WSDL2Java, the default constructor of the stub will then point to localhost. If the service is on other endpoint you must use the constructor with the endpoint as parameter... Maybe the problem is not that at all but as said on other answers, without the WSDL you're using as WSDL2Java input it's hard to say.

Vinze