WCF Rest服务客户端 - 参数名称区分大小写

时间:2010-02-02 16:49:41

标签: wcf rest

使用以下界面与.NET通信时,.NET使用参数名称条形码和分支构建请求正文XML。参数名称应为Barcode和Branch。是的,PHP服务器区分大小写。

我是否被迫将参数名称大写?或者我可以使用属性指定名称吗?

非常感谢 尼尔

[ServiceContract]
public interface IStockEnquiryService
{   
   [OperationContract]
   [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat =     WebMessageFormat.Xml, UriTemplate = "")]
   Branches GetStockInfo(string barcode, string branch);
}

1 个答案:

答案 0 :(得分:1)

尝试将MessageParameterattribute应用于方法参数,并在其Name属性中指定正确的大小写。