tags:

views:

485

answers:

3

Hello,

I was having a problem sending video data to a WCF restful service using post, my contract looks like this

 [OperationContract]
    [WebInvoke(Method = "POST",
                 ResponseFormat=WebMessageFormat.Json,
               BodyStyle = WebMessageBodyStyle.Wrapped,
               UriTemplate = "UploadMovie")]
    string UploadMovie(Stream stream);

This works ok when im sending some text data but does not work when i attempt to send Video data, I have some exception catching in place but it seems like the request is not even being processed, since i get no response and no exceptions get logged... anyone have any input on this?

Thanks

A: 

Check out this post on streaming in Restful WCF. It's reverse of what you want to do, but using the AdapterStream class will probably help.

JP Alioto
I am tranfering from an iPhone and don't have the .net framwork at my disposal
Daniel
+1  A: 

Hi, you can use the svclog app to determine exactly what is happening. You just have enable wcf logging

http://wcfsecurity.codeplex.com/Wiki/View.aspx?title=How%20to%20enable%20WCF%20message%20logging

If you are instantiating all wcf in code, you can just add an app.config with the correct information to your code directory and this will work. Just remember to take it out when you're done. Most likely you have some exception that the WCF framework is catching. That happened to me on a message that seemingly vanished into thin air.

Steve
Nothing gets logged to the file when the I make this request, gets logged for others tho =/
Daniel
I think the problem is the buffer size
Daniel
I would create a wcf client that consumes your service with debugging on and then call the service. If you are calling the function, it HAS to show up somewhere in the trace, either on the client or the server side. Make sure your tracing is at the highest level. @Daniel - It might be buffer size, the WCF tracing will tell you that. That was my original problem and I would have never figured it out without the trace
Steve
A: 

The problem was the buffer size, i ended up splitting the video up into chunks and sending it like that, thanks everyone for their input

Daniel