我制作了WCF REST服务和Silverlight客户端。 Localhost(开发服务器)上的通信(基于XML)工作正常,但在IIS 7.5(Windows Server 2008 R2)上则无法正常工作。 WCF服务已成功托管在IIS上,但是当客户端发送服务请求时,该服务将返回状态:异常终止(wtf?-不是404,200之类的html经典状态,而是异常终止)。 Silverlight客户端抛出System.Net.WebException:远程服务器返回错误:NotFound。 但是,如果我连续快速发送两个请求,则第一个返回已中止,第二个返回! 然后银光倒下。 我不明白...预先感谢您的答复!
WCF Web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="RESTapi_test.RestServiceImpl" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="RESTapi_test.IRestServiceImpl"
behaviorConfiguration="web" >
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>