I am having an issue with a WCF service call. The service takes a complex object that has many lists of objects inside of it. The problem occurs when the object gets too large. I am getting a communication exception that says Not Found. The call works as long as the item is not too large. Any help would be appreciated. Here is the relevant part of the client config file:
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICartService" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="../Services/Cart开发者_JAVA百科Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICartService"
contract="AccessPoint.RichClient.Wcf.ICartService"
name="BasicHttpBinding_ICartService" />
</client>
The web.config file has the following content:
<bindings>
<basicHttpBinding>
<binding name="basicHttpLargeMessage" closeTimeout="00:02:00"
openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:02:00"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="CartService.CartServiceBehavior"
name="AccessPoint.WcfServices.CartService">
<endpoint address="" behaviorConfiguration="CartServiceBehavior"
binding="basicHttpBinding" bindingConfiguration="basicHttpLargeMessage"
contract="AccessPoint.WcfServices.ICartService" />
</service>
<behaviors>
<serviceBehaviors>
<behavior name="CartService.CartServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph ="2147483647"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="CartServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
</behaviors>
Any server error will be reflected in Silverlight as a "Not Found" exception. You need to either use some network sniffing tool (such as Fiddler) to see if the response has some additional information about the error, or enable tracing at the server side to see why it's returning a non-successful response.
The post at http://blogs.msdn.com/b/silverlightws/archive/2010/09/23/debugging-wcf-services-in-silverlight.aspx has a video with lots of information about debugging WCF services in Silverlight.
精彩评论