开发者

Passing a stream to Restfull Wcf

开发者 https://www.devze.com 2023-01-31 09:43 出处:网络
I am 开发者_高级运维passing a stream to rest full wcf service.I would be setting up this stream as a payload and not in the uri.In this case what would be my uri template..

I am 开发者_高级运维passing a stream to rest full wcf service.I would be setting up this stream as a payload and not in the uri.In this case what would be my uri template..

my contract looks like this :

[ServiceContract]
public interface IRjisProxyWcfService
{
    [OperationContract]
    [WebInvoke(Method = "PUT", UriTemplate = "")]
    Stream Post(Stream inputStream);
}

What would be my uri template?


There is a good article at http://msdn.microsoft.com/en-us/magazine/dd315413.aspx

Theoretically it can be anything. E.g.

[ServiceContract]
public interface IRjisProxyWcfService
{
    [OperationContract]
    [WebInvoke(Method = "PUT", UriTemplate = "AAA/")]
    Stream Post(Stream inputStream);
}

[ServiceContract]
public interface IRjisProxyWcfService
{
    [OperationContract]
    [WebInvoke(Method = "PUT", UriTemplate = "AAA/BBB")]
    Stream Post(Stream inputStream);
}

However, when you are putting, the putting url should be baseurl/AAA (first case) or baseurl/AAA/BBB (in the second case).

Sriwantha Sri Aravinda


Your URI template would be the empty string, just the way you have specified it.

0

精彩评论

暂无评论...
验证码 换一张
取 消