2012-01-31 4 views
0

SilverlightアプリケーションでWebサービス呼び出しが発生しました。パラメータの項目数が約2500になると失敗します。パラメータが特定の(小)番号を超えたときにサービスコールが失敗する

var pointIds = new System.Collections.ObjectModel.ObservableCollection<int>(); 

が、私はこのようにそれを呼び出す:

引数には、監視可能なコレクションとして宣言されて

client.ServiceClient.MarkAllPointAsFavouriteAsync(Settings.Current.User.UserId,pointIds); 

とservicecallは次のように定義されています。

public void MarkAllPointAsFavourite(Guid userId, List<int> pointIds) 
    { 
     PointRepository.MarkAllPointAsFavourite(userId, pointIds); 
    } 

はなぜ約2500の整数のリストを呼び出すと失敗しますか?

特定のエラーがある:約2500の整数のリストを呼び出すとき

System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. 
    at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) 
    at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState) 
    at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState) 
    --- End of inner exception stack trace --- 
    at 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) 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult 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 Conwx.Net.Client.Framework.CustomerServiceReference.CustomerServiceClient.CustomerServiceClientChannel.EndMarkAllPointAsFavourite(IAsyncResult result) 
    at Conwx.Net.Client.Framework.CustomerServiceReference.CustomerServiceClient.Conwx.Net.Client.Framework.CustomerServiceReference.ICustomerService.EndMarkAllPointAsFavourite(IAsyncResult result) 
    at Conwx.Net.Client.Framework.CustomerServiceReference.CustomerServiceClient.OnEndMarkAllPointAsFavourite(IAsyncResult result) 
    at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)} 
+0

いいえ、非常に良い答えではありませんが、パラメータがもはや整数のリストではなく、リストを選択するための基礎となったフィルタになるように、サービスコールを書き換えました。 – Keller

答えて

0

なぜそれができませんの?

リストの約2100項目で失敗しています。これは、クエリを作成しているためです。この場合

あなたはあなたに定義を変更することにより、メソッドの呼び出し可能を作ることができる何かを返すいないよう:

[Invoke] 
public void MarkAllPointAsFavourite(Guid userId, List<int> pointIds) 
{ 
    PointRepository.MarkAllPointAsFavourite(userId, pointIds); 
} 

これは、制限を回避し。

呼び出しコードも少し変更する必要があります。

+0

お返事ありがとうございますが、どこでも '[Invoke]'属性(?)については何も見つかりません。これについて詳しく説明することができますか。 – Keller

関連する問題