ajax - How i can get user name? -


I have a WCF rest service and I need to get the name of the user within this service if I ask a question with the console app, then I can get the name.

Agreement

  Public Interface IService1 {[OperationContract ()] [WebInvoke (method = "post", ResponseFormat = WebMessageFormat. Jason, Request format = WebMessageJason)] List & lt; Data Test & gt; GetTestData (); [OperationContract] [WebInvoke (method = "post", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] Zero AddTestData (Data.Test value); }  

Service

ajax query

  function getdata () {$ .ajax ({type: 'post', url: "http: // localhost: 50,711 /Service1.svc/GetTestData ", datatype: 'json', success: function (data) {showData (data);}, error: function (e) {console.log (e.message);}}); };  

The best way to do this is to create sessions, call it easy for you What would that be? Use session


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -