错误:Azure上的零应用程序(非基础架构)端点

时间:2014-08-26 01:22:32

标签: wcf azure

我有一个正在运行的,成熟的WCF服务,我试图在Windows Azure上部署为Web角色(当然还有自定义包装器)。我的RoleEntryPoint.OnStart()方法创建一个ServiceHost实例,它以零应用程序端点错误跳转。配置(web.config)服务模型部分是:

  <system.serviceModel>
    <services>
      <service name="Linguasys.QualitativeAnalysis.Processing" behaviorConfiguration="defaultServiceBehavior">
        <endpoint address="" behaviorConfiguration="wcfAzureWrapperStoryMapping.StoryMapperAspNetAjaxBehavior" binding="webHttpBinding" contract="Linguasys.QualitativeAnalysis.IProcessing" />
<!--
        <endpoint address="soap" behaviorConfiguration="" binding="basicHttpBinding" contract="Linguasys.QualitativeAnalysis.IProcessing" />
-->
  </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="wcfAzureWrapperStoryMapping.StoryMapperAspNetAjaxBehavior">
  <!--
          <enableWebScript />
          -->
          <webHttp faultExceptionEnabled="true" />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="defaultServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <webHttpBinding></webHttpBinding>
      <basicHttpBinding></basicHttpBinding>
    </bindings>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
      <!--
      <serviceActivations>
        <add relativeAddress="StoryMapper.svc" service="Linguasys.QualitativeAnalysis.Processing"/>
      </serviceActivations>
      -->
    </serviceHostingEnvironment>
  </system.serviceModel>

不要介意激活位,基本HTTP绑定等。稍后会添加它们以查看它是否有效。

我发现web.config siterootapproot以及所有其他地方都有{{1}}。

我错过了什么?

1 个答案:

答案 0 :(得分:1)

您的RoleEntryPoint.OnStart()方法在WaIISHost.exe中运行,它对您的web.config一无所知。有关详细信息,请参阅http://azure.microsoft.com/blog/2010/12/02/new-full-iis-capabilities-differences-from-hosted-web-core/,有关流程运行方式的信息,请参阅http://blogs.msdn.com/b/kwill/archive/2011/05/05/windows-azure-role-architecture.aspx

两个选项:

  1. 将您的WCF配置移动到WebRole1.dll.config(或您的角色入口点二进制文件的名称)。确保将.config设置为Content并复制本地。
  2. 在w3wp中实例化您的ServiceHost(即Global.asax)。