我有一个运营合同(如下),我希望允许针对其进行GET和POST请求。 我如何告诉WCF接受单个OperationContract的两种请求类型?
[OperationContract,
WebInvoke(Method="POST",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
UriTemplate = "query")]
XElement Query(string qry);
[OperationContract,
WebInvoke(Method="GET",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
UriTemplate = "query?query={qry}")]
XElement Query(string qry);