2013-10-07 3 views
0

iis에서 wcf 애플리케이션을 호스트하고 Android 디바이스에서 액세스하여 json을 얻는 방법은 무엇입니까? iis에서 wcf 응용 프로그램을 호스팅하고 안드로이드 장치를 통해 액세스해야합니다. 어떻게 수행 할 수 있습니까?wcf 응용 프로그램을 호스팅하고 Android 장치에서 액세스하려면 어떻게해야합니까?

+0

[안드로이드와 WCF 서비스 소비하는 방법] (http://stackoverflow.com/questions/669764/how-to-consume-wcf-service-with-android) –

+0

나는 아직 IIS를 사용하여 WCF 서비스를 호스팅 할 수있었습니다. 고소하다. – user2818487

+0

그런 다음 질문은 'IIS를 사용하여 WCF 서비스를 호스팅하는 방법'이어야합니다. 질문 당신은 쉽게 답변을 찾을 수 있습니다 ... 이것에 대해 인터넷에 튜토리얼의 톤이 있습니다. 그 후, 두 번째 질문은 '안드로이드에서 액세스하는 방법'이며, 나와있는 stackoverflow 질문의 답이됩니다. stackoverflow 규칙을 읽으십시오. 질문 당 하나의 질문을해야합니다. 그리고 질문을하기 전에 약간의 검색을하십시오. –

답변

1

1) http://romenlaw.blogspot.in/2008/08/consuming-web-services-from-android.html

2)

일부 코드 조각 http://www.kevingao.net/wcf-java-interop 어떤 유래가

응답에서 .. .. 내가 당신을 위해 튜토리얼의 목록을 걸었습니다이 많은 자습서가 있습니다
[ServiceContract(Namespace="http://mycompany.com/LoginService")] 
public interface ILoginService 
{ 
    [OperationContract] 
    string Login(string username, string password); 
} 
The implementation of the service could look like this: 

public class LoginService : ILoginService 
{ 
    public string Login(string username, string password) 
    { 
     // Do something with username, password to get/create sessionId 
     string sessionId = "12345678"; 

     return sessionId; 
    } 
} 
You can host this as a windows service using a ServiceHost, or you can host it in IIS like a normal ASP.NET web (service) application. There are a lot of tutorials out there for both of these. 

The WCF service config might look like this: 

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 


    <system.serviceModel> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior name="LoginServiceBehavior"> 
        <serviceMetadata /> 
       </behavior> 
      </serviceBehaviors> 
     </behaviors> 

     <services> 
      <service name="WcfTest.LoginService" 
        behaviorConfiguration="LoginServiceBehavior" > 
       <host> 
        <baseAddresses> 
         <add baseAddress="http://somesite.com:55555/LoginService/" /> 
        </baseAddresses> 
       </host> 
       <endpoint name="LoginService" 
          address="" 
          binding="basicHttpBinding" 
          contract="WcfTest.ILoginService" /> 

       <endpoint name="LoginServiceMex" 
          address="mex" 
          binding="mexHttpBinding" 
          contract="IMetadataExchange" /> 
      </service> 
     </services> 
    </system.serviceModel> 
</configuration> 

씨 : How to Consume WCF Service with Android

,691,363 (210)

또한 코드 프로젝트에 좋은 튜토리얼에게이

http://www.codeproject.com/Articles/358867/WCF-and-Android-Part-I

당신은 WCF의 부분 일 경우, 위의 링크는 다음 부분이 꽤 많이 유용

에 대한 것, 당신을 위해 그 유용하지 않을 것

http://www.codeproject.com/Articles/361107/WCF-and-Android-Part-II

관련 문제