zoukankan      html  css  js  c++  java
  • 如何设置webservice头域

        //如何设置webservice头域:参数不够时,通过头域传参数,好处:不用动接口

       //必须要判断头头域长度,负责每次都会增加
        if (((org.apache.axis.client.Stub)WebServiceStubHelper.getXXStub()).getHeaders().length == 0)
                {
                    SOAPHeaderElement head1 = new SOAPHeaderElement(
                            "soapAuthAccount", "soapAuthAccount");
                    head1.addTextNode(soapAuthAccount);
                    head1.setActor(null);
                    head1.setPrefix("");
                    head1.setMustUnderstand(false);
                    ((org.apache.axis.client.Stub)WebServiceStubHelper.getXXStub()).setHeader(head1);
                   
                    SOAPHeaderElement head2 = new SOAPHeaderElement(
                            "soapAuthPasswd", "soapAuthPasswd");
                    head2.addTextNode(soapAuthPasswd);
                    head2.setActor(null);
                    head2.setPrefix("");
                    head2.setMustUnderstand(false);
                    ((org.apache.axis.client.Stub)WebServiceStubHelper.getXXStub()).setHeader(head2);
                }
                SOAPHeaderElement[] heads = ((org.apache.axis.client.Stub)WebServiceStubHelper.getXXStub()).getHeaders();
               
                try
                {
                    System.out.println("soapAuthAccount:" + heads[0]);
                    System.out.println("soapAuthPasswd:" + heads[1]);
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }

  • 相关阅读:
    Codeforces Round #620 (Div. 2) A-F代码 (暂无记录题解)
    Educational Codeforces Round 82 (Rated for Div. 2) A-E代码(暂无记录题解)
    微信小程序项目踩过的几个坑
    人工智能入门
    2017,知识与财富
    Cesium中Clock控件及时间序列瓦片动态加载
    Cesium基础使用介绍
    geotrellis使用(三十五)Cesium加载geotrellis TMS瓦片
    PhiloGL学习(6)——深情奉献:快乐的一家
    PhiloGL学习(5)——神说要有光,便有了光
  • 原文地址:https://www.cnblogs.com/qqzy168/p/3135355.html
Copyright © 2011-2022 走看看