2014-06-13 3 views
0

따뜻한 인사. 나는 내 Windows Phone 8.1 응용 프로그램에서 Java를 사용하여 개발 된 안심할 수있는 웹 서비스 (http://192.168.10.113:8087/cisms/mobilews/)를 어떻게 사용할 수 있는지 알고 싶습니다. 나는 C#으로 Visual Studio 2013을 사용하고 있습니다.Windows Phone에서 편안한 웹 서비스 사용 8.1

업데이트 : 웹 서비스 (http://192.168.10.152:8087/cisms/mobilews/login/userNameCheck?userName=supervisor)의 GET 메소드 중 하나에 다른 문제가 있습니다. 주어진 URL을 기반으로 다음 샘플 코드를 만들었을 때 또 다른 예외가 발생했습니다.

static string UserValidation() 
    { 
     HttpWebRequest req = WebRequest.Create("http://192.168.10.113:8087/cisms/mobilews/login/userNameCheck?userName=supervisor") as HttpWebRequest; 
     string result = null; 
     using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse) 
     { 
      StreamReader reader = 
       new StreamReader(resp.GetResponseStream()); 
      result = reader.ReadToEnd(); 
     } 
     return result; 
    } 

http://rest.elkstein.org/2008/02/using-rest-in-c-sharp.html 

이 예외는

'System.Net.HttpWebRequest' does not contain a definition for 'GetResponse' and no 
extension method 'GetResponse' accepting a first argument of type 
'System.Net.HttpWebRequest' could be found (are you missing a using directive or an 
assembly reference?) 

NB 아래와 같습니다 : 난 단지 Windows_Phone_application이 오류가 발생했습니다; Desktop_Application에는 없습니다. 사람이 더 나를 도울 수 있다면

, 즉 사전에

덕분에 좋은 것 세바스찬

답변

0

RestSharp는 웹 서비스를 쉽게를 요청할 수 있습니다. 또는 HttpClient을 사용할 수도 있습니다.

+0

나는 httpwebrequest 방법을 시도했지만 몇 가지 예외가 있습니다. 내가 사용하고있는 웹 서비스 방법 중 하나가 GET입니다. URL은 다음과 같습니다 ... http://192.168.10.152:8087/cisms/mobilews/login/userNameCheck?userName=supervisor 아래 URL을 따라 갔을 때 http://rest.elkstein.org/2008 /02/using-rest-in-c-sharp.html; 그것은 당신이 더 나를 도울 수 있다면 '하는 GetResponse' , 즉 내 작업 PC 앞에 모르겠지만 아마도 당신을 –

+0

좋은 것에 대한 정의를 포함하지 않는 다음과 같은 예외 'System.Net.HttpWebRequest'을 던졌다 'HttpWebResponse resp = ((req.GetResponseAsync()를 HttpWebResponse로 기다려라)' – fantastik78

+0

나는 이것을 시도했지만 같은 예외가있다. 이 오류는 Desktop_application이 아닌 windows_phone_application에서만 발생합니다. –

관련 문제