如何通过SOAP头在WSDL没有定义它? [英] How To Pass Soap Header When WSDL Doesn't Define It?

查看:108
本文介绍了如何通过SOAP头在WSDL没有定义它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web服务,我打电话和他们发布的WSDL实际上并没有定义服务的多了,它的3/4,你必须手动建立之后。

我的问题是,他们需要在它的一些特定信息的SOAPHEADER,但我没有任何办法做这件事的。唯一真正的东西,我对服务是创建的(的MyMethod),我可以通过我的消息,代理方法。如何设置/发送SOAP头用它呢?

所有我已经有服务的,我已经能够从Visual Studio中使用的自动绑定物品。

解决方案

我能得到这个工作用C手动修改自动生成的代理$ C $,只是注射的继承SOAPHEADER,并添加属性的类该方法<!/ P>

我不能重新生成或再新鲜的代理,但它得到了这份工作做的,只花了15分钟。

I have a web service that I am calling and their published WSDL doesn't actually define much of the service, 3/4 of it you have to manually build afterwards.

The problem I have is that they need a SoapHeader with some specific information in it, but I don't have any way of doing it. The only real things I have for the service is a proxy method that was created (MyMethod) that I can pass my message to. How can I set/send a soap header with it as well?

All of the services I've had, I have been able to use the automatically bound items from Visual Studio.

解决方案

I was able to get this done by modifying the auto-generated proxy code manually and simply injecting a class that inherited "SoapHeader" and added the attribute to the method!

I cannot re-generate or re-fresh the proxy, but it got the job done, and only took 15 minutes.

这篇关于如何通过SOAP头在WSDL没有定义它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆