可能だと思いますが、以下は私が理解した解決策です。
WCF インターフェイス
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate = "HelloWorld/{test}")]
string HelloWorld(string test);
}
WCF インターフェイスの実装
public class Service : IService1
{
return "Success from Hello World";
}
jQuery からの Ajax 呼び出し
$.ajax({
type: 'GET',
dataType: 'json',
contentType: 'application/json; charset=utf-8',
url: baseUrl + '/HelloWorld/TestString',
success: function (response) {
alert('Ping reply: ' + response);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
var jsonFault = JSON.parse(XMLHttpRequest.responseText);
alert('Reason: ' + jsonFault.Reason + '<br />Detail: ' + jsonFault.DetailedInformation);
}
});
私は単一のパラメータで試しました。私が間違っている場合は、もっと説明してください。
質問歓迎...