Stream Problem in WCF
-
Hello guys, Today guys at work i wanted to do a method in my WCF service that accepts a Stream which is going to be used to transfer a file from my client application trough WCf. After coding this everything worked fine i manged to make everything work and i started testing. When i tried the method with a file that was of 24kb of size everything worked correctly but the problems started when i tested with a file of size 64kb. Whenever i choose this file it kept giving me the following error "Bad Request(404)..." something like that can't remember the full error code at the moment. I tried to set the maximumReciveBuffer size and other sizes at the endpoint but still nothing it kep crashing when i gave it large file sizes. Any idea guys really need some help with this im kinda stuck tried searchin google but cant find an answer that i can understand. Thank you in advance Regards, Christian Pace
-
Hello guys, Today guys at work i wanted to do a method in my WCF service that accepts a Stream which is going to be used to transfer a file from my client application trough WCf. After coding this everything worked fine i manged to make everything work and i started testing. When i tried the method with a file that was of 24kb of size everything worked correctly but the problems started when i tested with a file of size 64kb. Whenever i choose this file it kept giving me the following error "Bad Request(404)..." something like that can't remember the full error code at the moment. I tried to set the maximumReciveBuffer size and other sizes at the endpoint but still nothing it kep crashing when i gave it large file sizes. Any idea guys really need some help with this im kinda stuck tried searchin google but cant find an answer that i can understand. Thank you in advance Regards, Christian Pace
You've done everything described here? How to: Enable Streaming[^]
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You've done everything described here? How to: Enable Streaming[^]
Mark Salsbery Microsoft MVP - Visual C++ :java:
Yes but i didn't understand this part. Do I have to specify all of these methods in the Contract?
[OperationContract]
Stream GetStream(string data);
[OperationContract]
bool UploadStream(Stream stream);
[OperationContract]
Stream EchoStream(Stream stream);
[OperationContract]
Stream GetReversedStream();In my case i just created one method that accepts a System.IO.Stream. The Stream works fine my problem arises when i am specifying a file that is of size 64Kb when i specified a file of 24Kb it worked just fine.
-
Yes but i didn't understand this part. Do I have to specify all of these methods in the Contract?
[OperationContract]
Stream GetStream(string data);
[OperationContract]
bool UploadStream(Stream stream);
[OperationContract]
Stream EchoStream(Stream stream);
[OperationContract]
Stream GetReversedStream();In my case i just created one method that accepts a System.IO.Stream. The Stream works fine my problem arises when i am specifying a file that is of size 64Kb when i specified a file of 24Kb it worked just fine.
cdpace wrote:
Do I have to specify all of these methods in the Contract?
No - that's an example of four different ways you could do it. You just need to satisfy the requirements listed above that example. I would recommend using streamed transfer mode instead of buffered transfer mode, unless the files are always going to be small. I know it works, so maybe create a sample service from scratch following the steps outlined in the docs. Then maybe you'll see what's different on your service configuration.
Mark Salsbery Microsoft MVP - Visual C++ :java: