如何通过SOAP头在WSDL没有定义它?定义、SOAP、WSDL

2023-09-06 09:57:26 作者:与其拼了命也要鹤立鸡群,不如努把力让自己离开那群鸡。下面小编

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

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

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

解决方案

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

我不能重新生成或再新鲜的代理,但它得到了这份工作做的,只花了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.