惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
Hacker News: Ask HN
Hacker News: Ask HN
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
WordPress大学
WordPress大学
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
N
Netflix TechBlog - Medium
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
S
Schneier on Security
T
Threat Research - Cisco Blogs
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Hacker News
The Hacker News
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Palo Alto Networks Blog
T
Tenable Blog
S
Secure Thoughts
T
Threatpost
V2EX - 技术
V2EX - 技术
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
罗磊的独立博客
P
Privacy & Cybersecurity Law Blog
Engineering at Meta
Engineering at Meta
小众软件
小众软件
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
Y
Y Combinator Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
P
Privacy International News Feed
H
Heimdal Security Blog
量子位
B
Blog

博客园 - dataxiu.com

[原创.数据可视化系列之十三]idw反距离权重插值算法的javascript代码实现 [原创.数据可视化系列之十二]使用 nodejs通过async await建立同步数据抓取 [原创.数据可视化系列之八]使用等d3进行灰度图转伪彩色 [原创.数据可视化系列之七]阿里竞赛作品技术展示 [原创.数据可视化系列之六]使用openlyaers进行公网地图剪切 [原创.数据可视化系列之五]韩国"萨德"系统防御图 [原创.数据可视化系列之四]跨平台,多格式的等值线和等值面的生成 [原创.数据可视化系列之三]使用Ol3加载大量点数据 [原创.数据可视化系列之二]使用cesium三维地图展示美国全球军事基地分布 [原创.数据可视化系列之一]使用openlayers 3 显示聚合数据 管理类软件的界面模板。 使用SilverLight开发ARPG游戏(一) 买联想学生机器的遭遇:问联想1(连载) 联想09年春节学生机开卖了。 谈UrlRewriter在XP和2003上IIS设置的差异 使用SilverLight构建插件式应用程序(九) —聊天插件客户端的实现 使用SilverLight构建插件式应用程序(八) —聊天插件Duplex WCF的实现 使用SilverLight构建插件式应用程序(七) 使用SilverLight构建插件式应用程序(六)
.NET 访问JAVA的WebService使用SOAP头
dataxiu.com · 2008-10-26 · via 博客园 - dataxiu.com

进来做的项目需要和JAVA的WebServices进行交互,其中访问WS的时候需要传入SOAP头进行验证。其中关键就是SOAP头内容。由于JAVA的WS在.NET下生成的代理是没有SOAP头的内容,所以需要手工修改代理类,达到可以传输SOAP头的目的。

1:修改代理类,建立SOAP头的对象:

 /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3053")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]  
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = true)]
    public partial class MySoapHeader : System.Web.Services.Protocols.SoapHeader
    {
        private string tokenValue;
        private System.Xml.XmlAttribute[] anyAttrField;
        /// <remarks/>
        //[XmlIgnoreAttribute]
        //[XmlAttribute("")]
        [XmlTextAttribute()]
        public string TokenValue
        {
            get
            {
                return this.tokenValue;
            }
            set
            {
                this.tokenValue = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlAnyAttributeAttribute()]
        public System.Xml.XmlAttribute[] AnyAttr
        {
            get
            {
                return this.anyAttrField;
            }
            set
            {
                this.anyAttrField = value;
            }
        }

    }

2:修改代理类,添加一个SOAP对象:

     private mySoapHeader soapHeaderValue;

    public MySoapHeader SoapHeaderValue
        {
            get
            {
                return this.soapHeaderValue;
            }
            set
            {
                this.soapHeaderValue = value;
            }

        }

 3:在需要SOAP上方法上添加如下的代码:

        [System.Web.Services.Protocols.SoapHeaderAttribute("SoapHeaderValue")]

   public bool verifyWebserviceTest()
        {
            object[] results = this.Invoke("verifyWebserviceTest", new object[0]);
            return ((bool)(results[0]));
        }

调用的时候使用如下代码:

  ArcWS.ManDispCmdSessionBeanService ws = new ARSSMonSite.ArcWS.ManDispCmdSessionBeanService();
            ArcWS.loginToken soapHeader = new ARSSMonSite.ArcWS.loginToken();
            soapHeader.TokenValue = "arsssongguixiang#19990101010101";
            ws.SoapHeaderValue = soapHeader;

            ws.verifyWebserviceTest();

这样,就可以正确的向JAVS的WS传送SOAP头的信息。