Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
code for interface
C#
[WebInvoke(UriTemplate = "/Login/{iUserName}/{iPassword}", Method = "GET", ResponseFormat = WebMessageFormat.Json)]
        Users Login(string iUserName, string iPassword);
        [WebInvoke(UriTemplate = "/Changepassword/{iUserName}/{iPassword}/{iOldPass}", Method = "GET", ResponseFormat = WebMessageFormat.Json)]
        string Changepassword(string iUserName, string iPassword, string iOldPass);


code for class
SQL
public Users Login(string iUserName, string iPassword)
        {
            return Global.ListUsers.Where(p => p.Value.Username.ToUpper() == iUserName.ToUpper() && p.Value.Pass_word == iPassword).Select(p => p.Value).FirstOrDefault();
        }

        public string Changepassword(string iUserName, string iPassword, string iOldPass)
        {
            return "OK";
        }


code for host

C#
private void OpenWebHost()
        {
            try
            {
                urlService = "http://192.168.1.251:33323";
                web = new WebServiceHost(typeof(TrackingCore.Android), new Uri(urlService));
                WebHttpBinding binding = new WebHttpBinding();
                binding.TransferMode = TransferMode.StreamedResponse;
                web.AddServiceEndpoint(typeof(TrackingCore.iAndroid), binding, "Android");
                web.Open();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }


Result Endpoint not found.
Thank!
Posted
Comments
E.F. Nijboer 18-Nov-15 3:49am    
Are you sure the same port is always used? (check if the port (and ip) is still http://192.168.1.251:33323 and accessable, using a browser for example)
[no name] 18-Nov-15 6:35am    
Error message clearly says that resource is not found on said address. Inaccessible on that IP and/or Port.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900