You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jeelani <sj...@infinitymarkets.com> on 2001/11/15 11:38:39 UTC
Urgent!! please help
Hi,
I am new to Axis. I got a small problem while accessing the service.
I am able to access a service by deploying it as a JWS. But when I deploy
the same service using deploy.xml file,
I am not able to access the service.
My code Configuration:
I am using Tomcat v4.0.
I Placed the axis directory present in webapps of default axis directory. My
service is a simple java bean (Hello.java) with only one method."sayHi" and
the return type is a java.lang.String object.
public class Hello {
public String sayHi(String name) {
return "Hai"+name;
}
}
I compiled the Java bean (Hello.java) and placed the class file under
tomcat-home\webapps\axis\WEB-INF\classes\Hello.class.
My deploy.xml file is:
<admin:deploy xmlns:admin="AdminService">
<service name= "Hello" pivot="RPCDispatcher">
<option name="className" value="Hello"/>
<option name="methodName" value="sayHi"/>
</service>
</admin:deploy>
I deployed the same using AdminClient.
Now when I access the file from the browser by giving the URL:
http://localhost:8080/axis/services/Hello?wsdl it says service not found.
I could not access from my java client also. The client program is as
follows:
import org.apache.axis.client.ServiceClient;
import org.apache.axis.encoding.BeanSerializer;
import org.apache.axis.utils.QName ;
public class HelloClient
{
public static void main(String [] args) {
try {
String endpoint = "http://localhost:8080/axis/services/Hello";
String methodName = "sayHi";
ServiceClient client = new ServiceClient(endpoint);
String response = (String) client.invoke("Hello",
methodName,
new Object [] { "Stephen"});
System.out.println(response);
} catch(Exception e){
System.out.println(e);
}
}
}
Please note that I am able to access a service by making it as .jws. I could
also get the WSDL file in this way.
Please help me in this regard.
Thanks,
Jeelani