0
我试图用多个参数来测试WCF REST服务。我只从我传入的参数中获得一个值,重置为空。我的代码或提琴手有什么问题。我希望有人能指出我的正确方向。WCF参数值为空
[OperationContract]
[WebInvoke(
BodyStyle = WebMessageBodyStyle.Wrapped,
Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "Valid/{Id}")]
string ValidateUser(LogInDetail loginDetail,string Id);
public string ValidateUser(LogInDetail loginDetail,string Id)
{
//your validation logic
return loginDetail.userName; //always null value
}
你可以尝试{loginDetail:{“userName”:“Name”,“password”:“Pwd”}}作为请求正文吗? –
我遵循您的评论,但不起作用。 :( – ib3an
)你有错误?你的LogInDetail对象看起来像什么? –