2011-08-01 113 views
0

我遇到了WCF服務調用的問題。該服務需要一個複雜的對象,其中包含許多對象列表。當對象變得太大時會出現問題。我收到一個說Not Found的通信異常。只要該項目不太大,該調用就可以工作。任何幫助,將不勝感激。下面是客戶端配置文件中的相關部分:未找到大對象的WCF錯誤

<bindings> 
    <basicHttpBinding> 
     <binding name="BasicHttpBinding_ICartService" maxBufferSize="2147483647" 
       maxReceivedMessageSize="2147483647"> 
      <security mode="None" /> 
     </binding> 
    </basicHttpBinding> 
</bindings> 
<client> 
    <endpoint address="../Services/CartService.svc" 
       binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICartService" 
       contract="AccessPoint.RichClient.Wcf.ICartService" 
       name="BasicHttpBinding_ICartService" /> 
</client> 

web.config文件有以下內容:

<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> 
+1

你可以添加確切的異常和堆棧跟蹤?多大? MB的? GB的? TB的? – rene

+0

以下是來自外部異常的堆棧跟蹤:System.ServiceModel.AsyncResult.End [TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels .ServiceChannel.EndCall(String action,Object [] outs,IAsyncResult result) at System.ServiceModel.ClientBase'1.ChannelBase'1.EndInvoke(String methodName,Object [] args,IAsyncResult result) at AccessPoint.WcfServices.CartWcfS .CartWcfSClient.CartWcfSClientChannel.EndSaveCart(IAsyncResult result) – dna86

+0

和內部異常的堆棧跟蹤:在System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod,Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) – dna86

回答

0

任何服務器錯誤將在Silverlight中反映爲「未找到」異常。您需要使用某些網絡嗅探工具(例如Fiddler)來查看響應是否包含有關錯誤的其他信息,或者在服務器端使用enable tracing以查看響應爲何返回不成功的響應。

http://blogs.msdn.com/b/silverlightws/archive/2010/09/23/debugging-wcf-services-in-silverlight.aspx的帖子有一個視頻,其中包含大量有關在Silverlight中調試WCF服務的信息。

+0

Fiddler什麼都沒有顯示,所以我猜測失敗發生在任何事情發送之前。 – dna86

+0

嘗試在服務器上啓用跟蹤,然後查看是否有一些其他信息。 – carlosfigueira

相關問題