如何在c#

时间:2016-02-05 15:23:58

标签: .net soap wsdl.exe

我使用wsdl.exe创建了一个代理类。它正在发送下面列出的肥皂信封,由于路由器的另一端需要一组不同的命名空间,所以它不起作用

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<sayHelloWorld xmlns="http://example.com/hro/benefits/helloworld/xsd/">
  <brokerHeader>
    <brokerUserId xmlns="http://my.com/hro/benefits/cm/xsd/v2_0">test</brokerUserId>
    <clientId xmlns="http://my.com/hro/benefits/cm/xsd/v2_0">010666</clientId>
    <callerRefId xmlns="http://my.com/hro/benefits/cm/xsd/v2_0">01066633934717</callerRefId>
  </brokerHeader>
  <greeting>Hello</greeting>
  <sleep>0</sleep>
</sayHelloWorld>
</soap:Body>
</soap:Envelope>

这不起作用,因为只有在soap信封中有以下值时,路由器才能工作

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:v2="http://my.com/hro/benefits/cm/xsd/v2_0" 
  xmlns:xsd="http://my.com/hro/benefits/helloworld/xsd/">

问题是如何更改代理类以发送所需的信封。

0 个答案:

没有答案