0

ログイン Web サービスを呼び出していますが、 server から取得する内容を確認できません。私はこれが好きですか?ここに私の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
        }
    })
    }
4

2 に答える 2

0

サービス URLのメソッド名MyMethodNameが抜けていたと思い ます。また、コンソールにクロス オリジン エラーがないことを確認します。メソッドのリストは、サービス URLのヘルプ ページから取得できます。

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

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

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

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

于 2013-10-01T08:51:46.013 に答える
0

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

于 2013-10-01T08:38:21.970 に答える