开发者

WCF Rest Service Client - Parameter Names are case sensitive

开发者 https://www.devze.com 2022-12-19 02:36 出处:网络
When using the following interface to talk to PHP from .NET, .NET builds the request body XML with parameter names barcode and branch.The parameter names should be Barcode and Branch.Yes, the PHP serv

When using the following interface to talk to PHP from .NET, .NET builds the request body XML with parameter names barcode and branch. The parameter names should be Barcode and Branch. Yes, the PHP server is case sensitive.

Am I forced to capitalise my parameter names? or can I specify names using attributes?

Many Thanks Neil

[ServiceContract]
public interface IStockEnquiryService
{   
   [OperationContract]
   [WebInvoke(Method = "POST", BodyStyle = WebMessa开发者_运维问答geBodyStyle.Wrapped, ResponseFormat =     WebMessageFormat.Xml, UriTemplate = "")]
   Branches GetStockInfo(string barcode, string branch);
}


Try applying the MessageParameterattribute to the method arguments and specify the right case in its Name property.

0

精彩评论

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