WCF service stop sending web requests once it's hosted in IIS
I have a WCF service that receive query from a silverlight client and send the query to a Search API (Bing, or Google), process the search results to return those back to the silverlight client.
Everything works find in Visual Studio.
Once I publish the service in IIS, I can access the service endpoint and the silverlight client to talk to the service as well. However, the service does not send any query to the Search API. I opened Fiddler to monitor the traffic. There is no web request send to search API.
Is there any setting in IIS, or firewall, that I neglected?
The web.config is attached below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SiteRankerBehavior">
<serviceMetadata httpGetEnabled="true开发者_StackOverflow中文版" />
<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>
Thanks Sarah
Ok, I found the solution here that exactly solved my problem. Basically, I need to add the following to web.config and everything works.
<system.net>
<defaultProxy>
<proxy usessystemdefault="False" proxyaddress="http://your-proxy-name.domain.com:port-number-if-any" bypassonlocal="True" autoDetect="False" />
</defaultProxy>
</system.net>
Why it worked in Visual Studio is still a mystery to me though. Strickly speaking, it worked before in Visual Studio if the Fiddler is running at the same time.
精彩评论