代码之家  ›  专栏  ›  技术社区  ›  erxuan

WCF服务在IIS中承载后停止发送Web请求

  •  0
  • erxuan  · 技术社区  · 15 年前

    我有一个WCF服务,它接收来自Silverlight客户端的查询并将查询发送到搜索API(Bing或Google),处理搜索结果以将其返回到Silverlight客户端。

    所有作品都可以在Visual Studio中找到。

    一旦我在IIS中发布了该服务,我就可以访问服务端点和Silverlight客户端来与该服务进行对话。但是,服务不会向搜索API发送任何查询。我打开小提琴来监视交通。没有发送到搜索API的Web请求。

    在IIS或防火墙中是否有我忽略的设置?

    web.config附加在下面:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>  
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="SiteRankerBehavior">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="true" />                  
                </behavior>              
            </serviceBehaviors>
        </behaviors>
        <services>
            <service behaviorConfiguration="SiteRankerBehavior" name="SiteDiscovery.SiteRanker">
                <endpoint address="" binding="basicHttpBinding" contract="SiteDiscovery.ISiteRanker">                   
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            </service>
        </services>
    </system.serviceModel>
    


    谢谢 莎拉

    1 回复  |  直到 15 年前
        1
  •  0
  •   erxuan    15 年前

    好的,我找到了解决办法 here 这完全解决了我的问题。基本上,我需要将以下内容添加到web.config中,一切都可以正常工作。

    <system.net>
        <defaultProxy>
            <proxy usessystemdefault="False" proxyaddress="http://your-proxy-name.domain.com:port-number-if-any" bypassonlocal="True" autoDetect="False" /> 
        </defaultProxy>
    </system.net>
    

    但是,为什么它在Visual Studio中工作对我来说仍然是个谜。很明显,如果小提琴手同时运行,它以前在Visual Studio中工作过。

    推荐文章