【发布时间】:2017-12-11 08:59:41
【问题描述】:
如何通过传递 json 来发布调用 SaveCorporateProfile 函数
[DataContract]
public class myclass
{
public string CompanyCode { get; set; }
public string Username { get; set; }
public string Password { get; set; }
}
[ServiceContract]
public interface ICustProfileService
{
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/SaveCorporateProfile?dt={dt}")]
string SaveCorporateProfile(myclass dt);
}
public string SaveCorporateProfile(myclass dt)
{
return "success";
}
【问题讨论】:
-
这就是你所追求的吗? Here is a link to a possible solution.