如何通过uri将参数传递给wcf jon中的下面的方法 [英] How to pass parameters to below method in wcf jon through uri
本文介绍了如何通过uri将参数传递给wcf jon中的下面的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你有以下方法,比如
,当我传递参数时,它发送erroe像方法不允许你可以引导或发送片段
[OperationContract]
[WebInvoke(UriTemplate =UpdateBook / {id} / {name })]
void UpdateBook(字符串id,字符串名称);
Hi,
Hi have below method like
when i pass parameters it send erroe like method not allowed can u guide or send snippets
[OperationContract]
[WebInvoke(UriTemplate = "UpdateBook/{id}/{name}")]
void UpdateBook(string id, string name);
推荐答案
嗨Suhelsa,
我希望这会对你有所帮助
Hi Suhelsa,
I hope this would help you
[OperationContract]
[WebInvoke(UriTemplate = "UpdateBook?id={id}&name={name}")]
void UpdateBook(string id, string name);
试试这个,让我知道....
为了进一步探索我建议你在谷歌搜索在WCF休息服务中传递多个参数: - )
问候,
RK
Try this and let me know....
For further exploration I suggest you to search in google to pass multiple parameters in WCF rest service :-)
Regards,
RK
这篇关于如何通过uri将参数传递给wcf jon中的下面的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文