Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Webservices in visual studio
    primarykey
    data
    text
    <p>i am new and need some help. i have created an wcf service application in visual studio and write an simple method of login which receive an parameter userid &amp; password then return an object of logged user object which have two fields name and organization.</p> <p><strong>LoggedUser Class:</strong></p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Runtime.Serialization; namespace crmpp_android_service { public class LoggedUser { public string name; public string organization; [DataMember] public string Name { get { return name; } set { name = value; } } [DataMember] public string Organization { get { return organization; } set { organization = value; } } } } </code></pre> <p><strong>OperationContract:</strong></p> <pre><code>[OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, UriTemplate = "login/?userid={userid} &amp; pass={pass}" )] [Description("User Login return username &amp; Organization currently affiliated")] LoggedUser login(string userid, string pass); </code></pre> <p><strong>Method Implementation in Service1.svc:</strong></p> <pre><code> public LoggedUser login(string userid , string pass) { LoggedUser log_usr = new LoggedUser(); log_usr.name = "Ahsan Mehdi"; log_usr.organization = "JDC"; return log_usr; } </code></pre> <p>but when i run application by pressing ctrl+F5 it open an wcf test Client like this and return data. <img src="https://i.stack.imgur.com/tS1A7.png" alt="enter image description here"></p> <p>I am unable to get response from android app or simply from browser when i write URL for service it shows me page like that.</p> <pre><code>http://localhost:57127/Service1.svc </code></pre> <p><img src="https://i.stack.imgur.com/sTxvM.png" alt="enter image description here"></p> <p>and when complete url like this</p> <pre><code>http://localhost:57127/Service1.svc/login/?userid=abc123&amp;pass123 </code></pre> <p>it returns nothing any guidelike or help please as soon as possible.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload