gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 14:20:38 24 4
gpt4 key购买 nike

当使用以下接口(interface)从 .NET 与 PHP 对话时,.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);
}

最佳答案

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

关于WCF Rest 服务客户端 - 参数名称区分大小写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2185876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com