axis客户端调用用axis方式发布的接口,报错:{http://xml.apache.org/axis/}HttpErrorCode:404
2017-08-16 15:04
776 查看
axis客户端调用用axis方式发布的接口,报错:{http://xml.apache.org/axis/}HttpErrorCode:404
原因是:
如下的address访问不了。在浏览器中输入http://127.0.0.1:8080/testProject/services/myService?wsdl,看能不能拿到wsdl文件。
public String XXX(String input) {
String address= "http://127.0.0.1:8080/testProject/services/myService?wsdl";
String action= "XXX";
org.apache.axis.client.Service service = new org.apache.axis.client.Service();
Call call;
try {
call = (Call) service.createCall();
try {
call.setTargetEndpointAddress(new java.net.URL(address));
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
call.setOperationName(action);
// Object[] obj;
String result;
try {
result = (String) call.invoke(new Object[] { input});
return result;
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
原因是:
如下的address访问不了。在浏览器中输入http://127.0.0.1:8080/testProject/services/myService?wsdl,看能不能拿到wsdl文件。
public String XXX(String input) {
String address= "http://127.0.0.1:8080/testProject/services/myService?wsdl";
String action= "XXX";
org.apache.axis.client.Service service = new org.apache.axis.client.Service();
Call call;
try {
call = (Call) service.createCall();
try {
call.setTargetEndpointAddress(new java.net.URL(address));
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
call.setOperationName(action);
// Object[] obj;
String result;
try {
result = (String) call.invoke(new Object[] { input});
return result;
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
相关文章推荐
- webservice Axis发布deploy.wsdd出错, {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Coction refused: connect
- Axis {http://xml.apache.org/axis/}HTTP (404)Not Found
- C#如何调用axis发布的带HTTP Basic Authentication验证的接口配置方式
- web service:AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- Apache Axis客户端调用WEBSERVICE三种方式
- 在与sap系统集成时遇到的问题.sap系统发布一webservice,java(xfire)作为客户端调用,调用时抛出如下异常: Wrong Content-Type and empty HTTP-Body received: ("HTTP Code 20
- WebService发布与调用问题:expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://schemas.xmlsoap.org/wsdl/}def
- WebService发布与调用问题:expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://schemas.xmlsoap.org/wsdl/}definitions
- AXIS客户端调用出错org.apache.axis.NoEndPointException
- webservice Axis发布deploy.wsdd出错, {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Coction refused: connect
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- 写cxf客户端代码,调用cxf接口时,报错:Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegist
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- webservice Axis {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: C
- Apache Axis客户端调用WEBSERVICE三种方式
- AXIS客户端调用出错org.apache.axis.NoEndPointException
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- restful接口客户端和服务端开发,HttpURLConnection,HttpClient,post ,get方式调用
- AXIS客户端调用出错org.apache.axis.NoEndPointException