【问题标题】:WCF calling webservices parameters returning nullWCF 调用 web 服务参数返回 null
【发布时间】:2014-06-20 00:30:38
【问题描述】:

我有这个网络服务

 [OperationContract]
            [WebInvoke(Method = "POST", UriTemplate = "UploadReceipt?CompanyCode={CompanyCode}&FileName={FileName}&FileContent={FileContent}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
            RestResponseInfo<bool> UploadReceipt(string CompanyCode, string FileName, string FileContent);

我这样称呼它

然后它会调用这个方法

public RestResponseInfo<bool> UploadReceipt(string CompanyCode, string FileName, string FileContent)
        {

}

但是当我通过检查调试器看到这个参数时,它返回的 null 值让我从 5 个小时就陷入了这个困境............

我也使用了 chrome 的提前休息服务,但仍然有这个问题

【问题讨论】:

  • @Uriil 所以我不明白吗?
  • 方法完成后仍然接收空参数

标签: c# asp.net web-services wcf .net-3.5


【解决方案1】:

检查后我标记了 我路过

<form runat="server" method="post" action="http://localhost:37542/AccountService.svc/UploadReceipt">

应该是这样的

 <form runat="server" method="post" action="http://localhost:37542/AccountService.svc/UploadReceipt?CompanyCode=1&FileName=Test&FileContent=/9j/4AAQ">

任何方式感谢您的支持:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多