簡體   English   中英

IIS 7.0中的WCF服務主機

[英]WCF Service host in IIS 7.0

我有一個WCF,當我在本地主機上運行它時,它已成功運行。 但是,當針對特定的域地址(www.esimsol.com)運行它時,我遇到了一個問題。 任何人都可以幫助我如何為(“ http://www.esimsol.com/evalservicesite/eval.svc”)進行配置。 我的本地主機配置文件是:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="EvalServiceLibrary.Service1Behavior"
        name="EvalServiceLibrary.EvalService">
        <endpoint address="" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8081/EvalServiceLibrary/EvalService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="EvalServiceLibrary.Service1Behavior">
          <!-- 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>
    </behaviors>
  </system.serviceModel>
</configuration>

注意:特別是基本地址

您必須將解決方案發布到名稱為http://www.esimsol.com的 iis服務器。 發布后,請嘗試使用以下地址運行您的服務:http://www.esimsol.com/evalservicesite/eval.svc,並將您的基本地址更改為

將loacalhost服務器8081發布到任何服務器之后,就不能使用它,它應該是localhost或您的網站名稱http://www.esimsol.com

去掉

   <identity>
      <dns value="localhost" />
   </identity>

   <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8081/EvalServiceLibrary/EvalService/" />
      </baseAddresses>
    </host>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM