Click here to Skip to main content
16,019,263 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created SmartDevice windows application for windows mobile CE 6.0. This application invoke web service method.
If i run application(exe) file from \Project\WinWebSer\WinWebSer\bin\Debug\ its working properly.
However, if i deploy, select device as Windows CE device, it throws error as "The remote server returned
an error: (404) Not found."


Here is my sample code
=========

string AccessKey = "Jf8lP";
string sEmailId = "james@abc.com";
string sPwdKey = "abc123";
string url = string.Empty;
url = "http://192.168.21.82:953/ExpressBeezServices.svc/IsValidAdminUser?XBKEY=" + AccessKey.Trim() + "&EmailId=" + sEmailId.Trim() + "&PwdKey=" + sPwdKey.Trim();


string strResult = string.Empty;
// declare httpwebrequet wrt url defined above
HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
// set method as POST/GET
webrequest.Method = "GET";
// set content type
webrequest.ContentType = "application/json; charset=utf-8";
// declare & read response from service
HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse();
// set utf8 encoding
Encoding enc = System.Text.Encoding.GetEncoding("unicode-1-1-utf-8");
// read response stream from response object
StreamReader loResponseStream = new StreamReader
(webresponse.GetResponseStream(), enc);
// read string from stream data
strResult = loResponseStream.ReadToEnd();
// close the stream object
loResponseStream.Close();
// close the response object
webresponse.Close();
MessageBox.Show(strResult);

========
How do i solve error ?

Please help me.

Thanks
Posted
Updated 12-Sep-14 2:30am
v2
Comments
Christian Amado 12-Sep-14 13:58pm    
http://www.codeproject.com/Answers/817338/How-to-create-Web-Services-in-windows-application?arn=0#answer1
Sergey Alexandrovich Kryukov 12-Sep-14 21:24pm    
Excuse me, where did you get such a beast, "unicode-1-1-utf-8"?
—SA
Ganesh11021423 15-Sep-14 1:09am    
Hello Christian Amado,

Do i need to configure network connection with desktop ?


Please, Please help me.

Do you have solution for the above issue?

Thanks
Ganesh11021423 15-Sep-14 3:54am    
Hello Sergey Alexandrovich Kryukov

yes, i get a beast at
Encoding enc = System.Text.Encoding.GetEncoding("unicode-1-1-utf-8");

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