Web 服务 URL 被 localhost 覆盖

发布于 2024-09-01 21:46:59 字数 424 浏览 2 评论 0原文

我有一个像这样的远程服务器上的 Web 服务的引用...

http://10.5.1.121/PersonifyWebServicePPROD/UniversalWebService/default.wsdl

当我调用 Web 服务并查看其 URL 属性时,它看起来像...

http://localhost/PersonifyWebServicePPROD/UniversalWebService/default.asmx

谁能告诉我为什么它用 localhost 覆盖远程服务器?提供 Web 服务的供应商说我必须引用 wsdl 而不是 asmx 才能使其正常工作。我尝试在 IIS 中运行它并作为文件系统上的 Web 应用程序运行它,但这两种情况都不起作用。这是在 .Net 3.5 框架上。

I have a reference to a web service on a remote server like such...

http://10.5.1.121/PersonifyWebServicePPROD/UniversalWebService/default.wsdl

The moment I invoke the web service and view its URL property it looks like...

http://localhost/PersonifyWebServicePPROD/UniversalWebService/default.asmx

Can anyone tell me why it's overwriting the remote server with localhost? The vendor that provided the web service said I have to reference the wsdl and not the asmx in order for it to work. I've tried running it both within IIS and as a web app on the filesystem and neither scenario work. This is on the .Net 3.5 framework.

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

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

发布评论

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

评论(1

独夜无伴 2024-09-08 21:46:59

由于这是旧版 ASMX Web 服务,因此由 IIS 托管。 IIS 确定它认为服务所在的 URL。查看托管服务的站点的 IIS 配置。特别是,查看是否设置了主机标头。

Since this is a legacy ASMX web service, it is hosted by IIS. IIS determines the URL it thinks the service is at. Look at the IIS configuration for the site where the service is hosted. In particular, look to see if a host header is set.

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