我制作了WCF REST服务和Silverlight客户端。 Localhost(开发服务器)上的通信(基于XML)工作正常,但IIS 7.5(Windows Server 2008 R2)上没有。 WCF服务成功托管在IIS上,但是当客户端发送服务请求时,该服务返回Status:Aborted(wtf? - 不是html经典状态,如404,200,但已中止)。 Silverlight客户端抛出System.Net.WebException:远程服务器返回错误:NotFound。但是,如果我快速连续发送两个请求,第一个返回Aborted,第二个WORKS!然后Silverlight掉了下来。我不明白......提前感谢您的回答!
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>