2017-04-20 10 views
0

웹 서비스를 처음 사용합니다.원격 컴퓨터에서 로컬 웹 서비스 액세스 (로컬 호스트와 IP 주소)

Visual Studio 2017 (서비스는 .svc 파일)을 사용하여 C#으로 웹 서비스를 만들었습니다.

이 웹 서비스는 원격 컴퓨터의 폴더에 게시됩니다.

나는 원격 컴퓨터에 연결할 때, 나는 URL을 사용하여 웹 서비스를 실행할 수 있습니다

http://localhost:1869/ServiceName.svc/

을하지만 내 컴퓨터에서 웹 서비스를 실행하기 위해 노력하고있어 때, 나는 수정 시도 '로컬 호스트'를 IP 주소로 대체하여 URL을 만들지 만 작동하지 않습니다.

로컬 웹 서비스에 원격으로 액세스 할 수 있습니까?

그렇지 않은 경우 웹 서비스를 게시하여 원격으로 액세스 할 수있는 가장 좋은 방법은 무엇입니까?

도움 주셔서 감사합니다. 아래

-EDIT-

페이지의 Web.config 코드입니다.

나는 원격 컴퓨터에 웹 서버를 생성하고 비주얼 스튜디오 솔루션 프로젝트를 배치/C에서 컴파일하려고 : \을 Inetpub \ wwwroot에가,

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <connectionStrings> 
     <add name="RsConnString" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|RestDB.mdf;User Instance=true" providerName="System.Data.SqlClient" /> 
    </connectionStrings> 
    <system.web> 
     <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
     <services> 
      <service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour"> 
       <!-- Service Endpoints --> 
       <!-- Unless fully qualified, address is relative to base address supplied above --> 
       <endpoint address="" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="web"> 
        <!-- 
       Upon deployment, the following identity element should be removed or replaced to reflect the 
       identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
       automatically. 
      --> 
       </endpoint> 
      </service> 
     </services> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior name="ServiceBehaviour"> 
        <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
        <serviceMetadata httpGetEnabled="true" /> 
        <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
        <serviceDebug includeExceptionDetailInFaults="false" /> 
       </behavior> 
      </serviceBehaviors> 
      <endpointBehaviors> 
       <behavior name="web"> 
        <webHttp /> 
       </behavior> 
      </endpointBehaviors> 
     </behaviors> 
     <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 

    </system.serviceModel> 
    <system.webServer> 
     <modules runAllManagedModulesForAllRequests="true" /> 
    </system.webServer> 

<system.data> 
    <DbProviderFactories> 
     <remove invariant="MySql.Data.MySqlClient" /> 
     <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> 
    </DbProviderFactories> 
    </system.data></configuration> 
도와
+0

서비스를 호스팅하는 방법에 따라 다릅니다. 자기 호스팅인가, 아니면 iis인가? – Digvijay

+0

답변 해 주셔서 감사합니다. 그것은 자기 호스팅입니다. – yoann

+1

basicHttpBinding, wsHttpBinding 등 어떤 바인딩을 사용하고 있습니까? 당신이 어떤 코드를 보여줄 수 있다면 좋을 것입니다 - 당신이 시도한 것 등 – Digvijay

답변

0

감사합니다 도움이되지 않았다! 그것은 제대로 IIS와 웹 사이트를 구성 귀결 link

:

나는 거기에서 다음 명령을 작동하게 할 수 있었다. 답변을

핵심 질문을했다 :

는 IIS에서 서버 수준에서 기본 인증을 사용할 수 있나요?

웹 관리 서비스에 대한 원격 연결을 활성화 했습니까?

웹 관리 서비스를 시작하셨습니까?

관리 서비스 위임 규칙이 있습니까?

방화벽이 TCP 포트 8172에서 서버로 들어오는 연결을 허용합니까?

관련 문제