zoukankan      html  css  js  c++  java
  • webservices 服务器未能识别 HTTP 头 SOAPAction 的值:.

    转自:https://blog.csdn.net/dxfasr/article/details/25029063

    在用java发送给webservice服务器的时候报如下错误:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
    faultSubcode: 
    faultString: 服务器未能识别 HTTP 头 SOAPAction 的值: 。
    faultActor: 
    faultNode: 
    faultDetail: 
    {http://xml.apache.org/axis/}stackTrace:服务器未能识别 HTTP 头 SOAPAction 的值: 。
    解决办法:
    Call call = (Call)service.createCall();

    //加入如下的方法:在调用的时候直接写
    call.setSOAPActionURI(http://rb-ht.com/方法名);


    写好的调用的例子如下:
    public static String invokeRemoteAddr(String wsdl, String method,
    Object[] objects) throws Exception {
    Service service = new Service();
    Call call;
    try {
    call = (Call) service.createCall();
    call.setSOAPActionURI("http://tempuri.org/receiveDataTask");
    call.setTargetEndpointAddress(wsdl);
    call.setOperationName(method);// WSDL里面描述的接口名称
    call.addParameter("orig",
    org.apache.axis.encoding.XMLType.XSD_STRING,
    javax.xml.rpc.ParameterMode.IN);// 接口的参数
    call.addParameter("sign",
    org.apache.axis.encoding.XMLType.XSD_STRING,
    javax.xml.rpc.ParameterMode.IN);// 接口的参数
    call.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);// 设置返回类型
    call.invoke(objects);
    return "end";
    } catch (ServiceException e) {
    throw new Exception(e);
    }


    }


    如果修改后还是有错误:

    这个时候仔细检查targetNameSpace命名空间是否正确、配置正确后、即可

  • 相关阅读:
    effective c++ 笔记 (30-31)
    设计模式 笔记 装饰模式 Decorator
    设计模式 笔记 组合模式 Composite
    设计模式 笔记 外观模式 Facade
    effective c++ 笔记 (26-29)
    设计模式 笔记 桥接模式 Bridge
    设计模式 笔记 适配器模式 Adapter
    算法导论 第二章作业
    设计模式 创建型模式实践
    设计模式 笔记 单例模式 Singleton
  • 原文地址:https://www.cnblogs.com/sharpest/p/7852734.html
Copyright © 2011-2022 走看看