【问题标题】:SOAP web service, change namespace without editing code?SOAP Web 服务,更改命名空间而不编辑代码?
【发布时间】:2011-09-05 16:01:33
【问题描述】:

我是否能够更改所有 SOAP Web 服务方法中的命名空间,无需编辑代码

这一行……​​

<ConfirmIdentity xmlns="http://www.domain.com"> ?

这可能吗?

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ConfirmIdentity xmlns="http://www.domain.com">
      <ConfirmIdentityRequest>
        <ApplicationCrediential>
          <API_Username>string</API_Username>
          <API_Password>string</API_Password>
        </ApplicationCrediential>
        <SessionId>string</SessionId>
      </ConfirmIdentityRequest>
    </ConfirmIdentity>
  </soap:Body>
</soap:Envelope>

【问题讨论】:

  • 网络服务是用什么语言创建的?
  • 它在 C# 中,但我无法编辑代码:(
  • 为什么不自己做一个消耗那个的呢?
  • 我想可以这样做,如果这是唯一的方法 - 只是需要更多时间。

标签: c# asp.net web-services soap namespaces


【解决方案1】:

据我所知,您无法更改命名空间,它是在类和方法的上下文中设置的。即使你以某种方式将它从另一个包装起来,它仍然会覆盖。您唯一的选择是代理消费者。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-19
    • 2022-01-17
    • 1970-01-01
    • 2011-02-22
    • 1970-01-01
    • 2017-01-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多