【问题标题】:WCF Web Service encountered 404 in AzureWCF Web 服务在 Azure 中遇到 404
【发布时间】:2010-04-12 22:46:39
【问题描述】:

我是使用 WCF 和 Azure 的新手,但我有一个 WCF Web 服务,在 Visual Studio 中调试时可以正常工作。我将启动项目设置为 Azure,但我尝试的任何与服务相关的 URL 都会出现 404 错误。

这是我认为相关的代码: 来自 IWebService.cs

[OperationContract]
[WebGet(UriTemplate = "GetData/Xml?value={value}", ResponseFormat=WebMessageFormat.Xml)]
string GetDataXml(string value);

来自 Web.config:

<system.serviceModel>
  <services>
    <service name="WebService" behaviorConfiguration="WebServiceBehavior">
      <!-- Service Endpoints -->
      <endpoint address="" binding="webHttpBinding" contract="IWebService" behaviorConfiguration="WebEndpointBehavior"></endpoint>
      <endpoint address="ws" binding="wsHttpBinding" contract="IWebService"/>
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="WebServiceBehavior">
        <serviceMetadata httpGetEnabled="true"/>
        <serviceDebug includeExceptionDetailInFaults="true"/>
      </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
      <behavior name="WebEndpointBehavior">
        <webHttp/>
      </behavior>
    </endpointBehaviors>
  </behaviors>
</system.serviceModel>

我尝试将绑定更改为“basicHttpBinding”,但没有成功。

提前感谢您的帮助!

【问题讨论】:

    标签: azure web-services wcf azure-web-app-service


    【解决方案1】:

    经过更多的挖掘,我得到了它的工作。 我必须这样做:

    1. 以管理员身份运行 Visual Studio 命令行。
    2. 转到 C:\Windows\Microsoft .NET\Frameword v3.0\Windows Communication Foundation
    3. 运行“servicemodelreg -i”

    这将安装查看服务所需的所有东西。

    【讨论】:

    • 您是否在 Azure Web 角色上运行过这个?
    猜你喜欢
    • 1970-01-01
    • 2018-08-20
    • 2016-02-28
    • 2011-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-23
    • 2012-05-27
    相关资源
    最近更新 更多