Hi ,
I am using tomcat version 5 and Axis 1_2RC2 .I have successfully deployed the web service
http://localhost:8080/axis/helloWorld.jws .But i am unable to test the service .I have written a client code as follows :
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import javax.xml.rpc.ParameterMode;
public class CalcClient
{
public static void main(String[] args) throws Exception
{
String endpoint = "http://localhost:8080/axis/HelloServer.jws";
String method = "sayHelloTo";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( method );
call.addParameter( "op1", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_STRING );
String ret = (String)call.invoke("","sayHelloTo",new Object [] {args[0]});
System.out.println(ret);
}
}
But when I try to execute this I am getting the following exceptions :
- Unable to find required classes (javax.activation.DataHandler and javax.mail.i
nternet.MimeMultipart). Attachment support is disabled.
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection refused: connect
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Conne
ction refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSoc
ketFactory.java:138)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSoc
ketFactory.java:99)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:1
31)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.ja
va:370)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:88)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:147)
at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
at org.apache.axis.client.Call.invoke(Call.java:2702)
at org.apache.axis.client.Call.invoke(Call.java:2378)
at org.apache.axis.client.Call.invoke(Call.java:2301)
at CalcClient.main(CalcClient.java:32)
{http://xml.apache.org/axis/}hostname:BCD-DDTQ
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSoc
ketFactory.java:138)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSoc
ketFactory.java:99)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:1
31)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.ja
va:370)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:88)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:147)
at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
at org.apache.axis.client.Call.invoke(Call.java:2702)
at org.apache.axis.client.Call.invoke(Call.java:2378)
at org.apache.axis.client.Call.invoke(Call.java:2301)
at CalcClient.main(CalcClient.java:32)
Can some please help as I am a newcomer to the web services .
Thanks
Parijat