【发布时间】:2009-11-25 12:36:04
【问题描述】:
我有一个这样的 WebInvoke 方法;
[OperationContract]
[WebInvoke(
Method = "POST",
UriTemplate = "/go",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml
)]
string go(string name);
然后我像这样发布数据;
System.Net.WebClient client = new System.Net.WebClient();
string reply = client.UploadString(
"http://localhost/HelloService/Service.svc/go",
"POST",
aString);
问题是如何在 go() 方法中获取已发布消息中的数据,而不使用这样的 uri 模板;
UriTemplate = "/go({name})"
因为我要发送大量数据,无法在uri模板中发送
【问题讨论】: