修复 ContractRef 和 docRef 上的非标准 Web 服务器端口

发布于 2024-08-05 13:39:01 字数 865 浏览 1 评论 0原文

我的问题与此密切相关:如何我可以从非标准端口使用 .NET Web 服务吗?。我的 Web 服务在端口转发防火墙后面运行,因此 WSDL 文档中报告的端口号包含内部高编号端口。我编写了一个 SoapExtensionReflector 类,它能够重写 WSDL 文档。因此,像 example.com/path/loginservice?wsdl 这样的请求会被正确处理。

但是,这不会处理“disco”请求:example.com/path/loginservice?disco。这将返回如下 XML 文档:

<discovery>
  <contractRef ref="http://example.com:10092/loginservice.asmx?wsdl" docRef="http://example.com:10092/loginservice.asmx"/>
  <soap address="http://example.com/path/loginservice.asmx" binding="q1:LoginServiceSoap"/>
  <soap address="http://example.com/path/loginservice.asmx" binding="q2:LoginServiceSoap12"/>
</discovery>

虽然 SoapExtensionReflector 已正确重写了soap 绑定,但contractRef 和docRef URL 具有高编号端口。我怎样才能重写它们呢?

My problem is closely related to this one: How can I use .NET web services from non-standard ports?. My web service runs behind a port-forwarding firewall, so the port numbers reported in the WSDL document contain the internal high-numbered port. I wrote a SoapExtensionReflector class which is able to rewrite the WSDL document. So a request like example.com/path/loginservice?wsdl is handled correctly.

However, this doesn't handle the "disco" request: example.com/path/loginservice?disco. This returns an XML document like this:

<discovery>
  <contractRef ref="http://example.com:10092/loginservice.asmx?wsdl" docRef="http://example.com:10092/loginservice.asmx"/>
  <soap address="http://example.com/path/loginservice.asmx" binding="q1:LoginServiceSoap"/>
  <soap address="http://example.com/path/loginservice.asmx" binding="q2:LoginServiceSoap12"/>
</discovery>

While the soap bindings have been properly re-written by the SoapExtensionReflector, the contractRef and docRef URLs have the high-numbered port. How can I rewrite them as well?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

送你一个梦 2024-08-12 13:39:01

终于想通了一些事情。将所有内容迁移到 WCF 后,使用 svcutil 手动创建代理类。我想您可能可以使用旧的 asp.net Web 服务附带的 wsdl 工具做同样的事情,但我还没有尝试过。

Finally figured something out. Created proxy classes manually using svcutil after migrating everything to WCF. I figure you could probably do the same thing using the wsdl tool that came with the old asp.net web services, but I haven't tried that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文