Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229110

IONIC call webservice token

$
0
0

ok, its really exactly the same

    url: webapihost + "api/login",
    type: "POST",
    data: JSON.stringify({
        /*
         Following are the Credentials required to connect to the WebAPI server. Valiable model contains the credensial as they would be entered by an EBS user 
        */
        SubscriptionPassword: 'passx', 
        model: {
            BranchID: "01",
            LangID: "el-GR",
            UserID: "khcadmin",
            Password: "P@ssw0rd"
        }
    }),
    contentType: "application/json; charset=utf-8",

becomes

url=webapihost + "api/login";
authorization_data=
        /*
         Following are the Credentials required to connect to the WebAPI server. Valiable model contains the credensial as they would be entered by an EBS user 
        */
        {
        SubscriptionPassword: 'passx', 
        model: {
            BranchID: "01",
            LangID: "el-GR",
            UserID: "khcadmin",
            Password: "P@ssw0rd"
        }
       };

options={contentType:"application/json; charset=utf-8"}
return this.http.post(url, authorization_data, options);

on return you get an xml document with the token in it

token = result.Model.WebApiToken;
        document.getElementById("token").innerText = token;

Viewing all articles
Browse latest Browse all 229110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>