无法调用 IIS 托管的 WCF

发布于 2024-12-26 10:03:03 字数 1198 浏览 0 评论 0原文

我正在尝试在 IIS 中托管我的 WCF 服务以进行内部测试。

我在测试网站中添加和使用该服务没有问题 与 IIS 在同一台 PC 中。 我还可以将该服务添加到另一个测试网站中 电脑(局域网连接)。

问题是当我尝试使用该服务时 在另一台 PC 中的另一台 PC 中测试网站(已连接 LAN), 该服务总是说它无法响应。

我真心希望这里有经历过这种情况的人 可以分享您的宝贵经验。谢谢。

PS:抱歉我蹩脚的英语。

这是我的 WCF web.config:

<system.serviceModel>
        <services>
            <service behaviorConfiguration="GeoIPService.ServiceMethodBehavior" name="GeoIPService.ServiceMethod">
                <endpoint address="" binding="wsHttpBinding" contract="GeoIPService.IServiceMethod"/>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="GeoIPService.ServiceMethodBehavior">
                    <serviceMetadata httpGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>

谨致问候, 贾森

I'm trying to host my WCF service in IIS for internal testing.

I have no problem to add and consume the service in testing website
inside the same PC as IIS.
I also able to add the service into my testing website in another
PC (LAN connection).

But the problem is that when I try to consume the service in
testing website in another PC inside another PC (LAN connected),
the service always keep saying that it failed to response.

I do hope anyone here who have experienced this kind of situation
can share your precious experience. Thanks.

p.s: sorry for my broken english.

Here's my WCF web.config:

<system.serviceModel>
        <services>
            <service behaviorConfiguration="GeoIPService.ServiceMethodBehavior" name="GeoIPService.ServiceMethod">
                <endpoint address="" binding="wsHttpBinding" contract="GeoIPService.IServiceMethod"/>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="GeoIPService.ServiceMethodBehavior">
                    <serviceMetadata httpGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>

Best regards,
Jason

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

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

发布评论

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

评论(1

南七夏 2025-01-02 10:03:03

如果您可以将 URL 的格式发布到您的服务,这也会有帮助以及您遇到的错误。

对于快速且一般的连接问题,我通常求助于 Fiddler (http://www.fiddler2.com/fiddler2/)。该工具显示客户端和服务器之间的流量。下一步是打开 WCF 诊断,但在此之前请确保您可以:ping 目标服务器,您可以通过 URL 导航到服务端点,并使用 fiddler 获得进一步的连接调试帮助。

If you could post the format of the URL to your service that would help too as well as error you are getting.

For a quick and general connectivity issue I typically resort to Fiddler (http://www.fiddler2.com/fiddler2/). This tool shows the traffic between client and server. The next step would be turning on WCF diagnostics but before that make sure that you can: ping the target server, that you can navigate via URL to the service end point, and use fiddler for further connectivity debugging assistance.

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