/ / jqueryを使用してwcf webservice jsonを呼び出す方法は? -jquery、json、wcf、web-services

どのようにwcf webservice json jqueryを使用して呼び出すには? - jquery、json、wcf、web-services

ログインWebサービスを呼び出していますが、サーバーから取得するものを確認できません。私はこれが好きですか? ここに私のURLとパラメータがあります

ここは私の試しです http://jsfiddle.net/LsKbJ/2/

$(document).ready(function () {
//event handler for submit button
$("#btnSubmit").click(function () {
//collect userName and password entered by users
var userName = $("#username").val();
var password = $("#password").val();

//call the authenticate function
authenticate(userName, password);
});
});

//authenticate function to make ajax call
function authenticate(userName, password) {
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: "http://ii.c-cc.de/pp/REST",
dataType: "json",
async: false,
crossDomain: true,
//json object to sent to the authentication url
data: {Username: userName, Password: password},
success: function () {
//do any process for successful authentication here
}
})
}

回答:

回答№1は0

WCFを使用してデータを取得および投稿するREST APIを作成することをお勧めします


回答№2の場合は0

メソッド名を逃したと思う MyMethodName サービスURL。 また、コンソールにクロスオリジンエラーがないことを確認してください。 メソッドのリストは ヘルプページ サービスURLの。

// ajax呼び出しを行う関数を認証します

url: "http://isuite.c-entron.de/CentronService/REST/MyMethodName",

例: url: http://isuite.c-entron.de/CentronService/REST/GetLoggedInUser

置換 MyMethodName 上記の認証メソッドのURLに適切なメソッド名を使用します。