I have code to call this service in my silverlight control:
string fileName = "somestring";
string content = "somerandomstring";
var fs = new FileUploadService.FileUploadServiceClient();
fs.DoUploadCompleted +=new EventHandler<FileUploadService.DoUploadCompletedEventArgs>(fs_DoUploadCompleted);
fs.DoUploadAsync(fileName, content);
It works fine until I put a longer string in the content variable. I would get an error in the following generated code in Reference.cs:
public string EndDoUpload(System.IAsyncResult result)
{
object[] _args = new object[0]; string _result = ((string)(base.EndInvoke("DoUpload", _args, result))); //Error here
return _result;
}
The error message is:
An exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll but was not handled in user code
Additional information: [UnexpectedHttpResponseCode]
Arguments:Not Found
I did all tests to see how long I can set the content string variable without getting error. The magic number is 8192. If the string length is greater than 8192, I would get the error. But works fine for shorter string.
Is this a bug?
Sally Xu
Software Engineer
Aprimo, Inc
Please remember to mark the replies as answers if they answered your question
sladapter
All-Star
43609 Points
7910 Posts
Calling WCF service problem
Mar 14, 2008 01:35 AM | LINK
I have a simple WCF service looks like this:
I have code to call this service in my silverlight control:
It works fine until I put a longer string in the content variable. I would get an error in the following generated code in Reference.cs:
The error message is:
I did all tests to see how long I can set the content string variable without getting error. The magic number is 8192. If the string length is greater than 8192, I would get the error. But works fine for shorter string.
Is this a bug?
Software Engineer
Aprimo, Inc
Please remember to mark the replies as answers if they answered your question
jackbond
Contributor
5812 Points
1559 Posts
Re: Calling WCF service problem
Mar 14, 2008 01:55 AM | LINK
I think you've hit the limit for the default max size on a web service request. This thread might help you:
http://silverlight.net/forums/t/11313.aspx
On a side note, I'm curious, why do you have a Sleep statement there?
Khet - The first Silverlight multiplayer game
Zork I: The Great Underground Empire
sladapter
All-Star
43609 Points
7910 Posts
Re: Calling WCF service problem
Mar 14, 2008 02:00 PM | LINK
Thanks jackbond!
The solution in the link you provided solved problem.
By the way, the Thread.Sleep statement is there for testing purpose. It will be replaced with real code.
Software Engineer
Aprimo, Inc
Please remember to mark the replies as answers if they answered your question