Hi, I created a Web Service and I used Axis2.
I have generate all classes ( skeleton, stub) but when i try to run my client i have this problem:
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:364)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:208)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at ws.example.TemperatureConverterStub.c2FConvertion(TemperatureConverterStub.java:463)
at ws.example.TemperatureConverterServiceClient.main(TemperatureConverterServiceClient.java:63)
i don't understand why
i post you the code of my client :
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
/**
* Client for Temperature Converter Service
*/
public class TemperatureConverterServiceClient {
public static void main(
String[] args) {
TemperatureConverterStub stub;
try {
double c_value = 32;
stub = new TemperatureConverterStub ("http://localhost:8080/axis2/services/TemperatureConverter");
TemperatureConverterStub.C2FConvertion c2f = new TemperatureConverterStub.C2FConvertion();
c2f.setCValue(c_value);
TemperatureConverterStub.C2FConvertionResponse res = stub.c2FConvertion(c2f);
System.out.println("C Value : "+c_value+ "\tResult : " +res.get_return());
TemperatureConverterStub.F2CConvertion f2c = new TemperatureConverterStub.F2CConvertion();
f2c.setFValue(res.get_return());
TemperatureConverterStub.F2CConvertionResponse res1 = stub.f2CConvertion(f2c);
System.out.println("F Value : "+res.get_return()+ "\tResult : " +res1.get_return());
} catch (AxisFault e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
please help me!! is very important!! thanks!!!