wcq686 2016-04-12 02:32 采纳率: 42.9%
浏览 6410
已采纳

java调用webservice时报 faultString: (404)Not Found

******* request *******
<?xml version="1.0" encoding="GBK"?>


ESS
ESS0025
AEGON_WS_ESS_USER_LOGIN






0
2014-05-13 13:57:01


1926099983
abcde

Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (404)Not Found
faultActor:
faultNode:
faultDetail:
{}:return code: 404
<html><head><title>Apache Tomcat/6.0.18 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /ESS_DEV/services/EssQueryServer</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/ESS_DEV/services/EssQueryServer</u></p><p><b>description</b> <u>The requested resource (/ESS_DEV/services/EssQueryServer) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>
{http://xml.apache.org/axis/}HttpErrorCode:404

(404)Not Found
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.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:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.aegon_cnooc.ess.WebService.client.EssQueryServerSoapBindingStub.communicationChange(EssQueryServerSoapBindingStub.java:676)
at com.aegon_cnooc.ess.WebService.ServiceClientTest.testEssQueryServer(ServiceClientTest.java:96)
at com.aegon_cnooc.ess.WebService.ServiceClientTest.main(ServiceClientTest.java:29)

java测试:
public static void testEssQueryServer() throws Exception {
    String encode = "GBK";
    System.out.println("******* request *******");
    String request = readFile(requestXMLFile, encode);
    // 调用WebService
    EssQueryServerServiceLocator services = new EssQueryServerServiceLocator();
    EssQueryServerSoapBindingStub client = (EssQueryServerSoapBindingStub) services
            .getEssQueryServer();
    String response = client.communicationChange(request);
    System.out.println("******* response *******");
    writeXML(response, responseXMLFile, encode);
}


webservice 代码:
 public java.lang.String communicationChange(java.lang.String reqestXML) throws java.rmi.RemoteException {
    if (super.cachedEndpoint == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    org.apache.axis.client.Call _call = createCall();
    _call.setOperation(_operations[11]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("");
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new javax.xml.namespace.QName("http://server.WebService.ess.aegon_cnooc.com", "communicationChange"));

    setRequestHeaders(_call);
    setAttachments(_call);

try { ** java.lang.Object _resp = _call.invoke(new java.lang.Object[] {reqestXML});**这一行报错

    if (_resp instanceof java.rmi.RemoteException) {
        throw (java.rmi.RemoteException)_resp;
    }
    else {
        extractAttachments(_call);
        try {
            return (java.lang.String) _resp;
        } catch (java.lang.Exception _exception) {
            return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
        }
    }

} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}

  • 写回答

5条回答 默认 最新

  • wcq686 2016-04-20 09:35
    关注

    我已经知道了 是有一个地址写错了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 python天天向上类似问题,但没有清零
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 C#调用python代码(python带有库)
  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)