【问题标题】:upload WCF service to host somee.com?将 WCF 服务上传到托管 somee.com?
【发布时间】:2012-12-05 21:58:19
【问题描述】:

链接 (http://futuregreatdoctor.somee.com/WcfSvcSiteMCAT/service.svc) 它工作 .但是我将我的服务上传给了某些人,它不起作用:( (http://nck.somee.com/Server/Service1.scv)

Web.config

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>

    <serviceHostingEnvironment  multipleSiteBindingsEnabled="true">
      <baseAddressPrefixFilters>
        <add prefix="http://nck.somee.com/Server/"/>
      </baseAddressPrefixFilters>
    </serviceHostingEnvironment>

    <services>
      <service name="Server.Service1">
        <endpoint address="" binding="webHttpBinding" contract="Server.IService1" behaviorConfiguration="web"/>
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>

  </system.serviceModel>
 <system.webServer>
     <handlers>
       <add name="Service1.svc" verb="Service1" path="Service1.svc" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </handlers>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

请帮帮我!

【问题讨论】:

标签: wcf configuration web-config hosting host


【解决方案1】:

【讨论】:

    【解决方案2】:

    打开http://nck.somee.com/Server/Service1.scv时看到404错误

    这很可能意味着 IIS 配置不正确。

    尝试将静态文件(html 或 txt)放在存储 Service1.scv 的文件夹中。

    确保您可以使用http://nck.somee.com/Server/myfile.htm 之类的 URL 打开该静态文件,以检查 IIS 是否可以看到您的文件夹。

    更新:

    IIS 显示用于查找服务的路径 - d:\DZHosts\LocalUser\Kycomputer555\www.nck.somee.com\Server\Service1.scv

    这是正确的路径吗?

    【讨论】:

      【解决方案3】:

      在 IIS 中托管 WCF 服务 如果您的 WCF 服务具有扩展名 .svc,则需要在 Web.Config 文件中为该扩展名添加托管处理程序。

      Web.Config Handler 配置示例:

      v3

      v4

      http://somee.com/doka/DoHelpTopics.aspx?docode=false&thnid=113

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-09-18
        • 1970-01-01
        • 2011-05-17
        • 2014-08-31
        相关资源
        最近更新 更多