简体   繁体   English

在Windows Azure上运行WCF服务时获取“拒绝访问”异常消息

[英]Getting 'Access is Denied' exception message when running WCF service on Windows Azure

I am trying to build a Healthvault WCF web service that requires an x509 certificate to deploy on Windows Azure in C# using Visual Studio 2010. When I debug the solution on my local IIS7, I can perform all functions no problem. 我正在尝试构建一个Healthvault WCF Web服务,该服务需要使用Visual Studio 2010在C#的Windows Azure上部署x509证书。在本地IIS7上调试解决方案时,我可以执行所有功能,没有问题。 When I deploy to Windows Azure and try to run any of my methods, I get this error. 当我部署到Windows Azure并尝试运行任何方法时,都会出现此错误。

The server encountered an error processing the request. 服务器在处理请求时遇到错误。 The exception message is 'Access is denied.'. 异常消息为“访问被拒绝”。 See server logs for more details. 有关更多详细信息,请参见服务器日志。 The exception stack trace is: 异常堆栈跟踪为:

at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) 在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(在System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象实例,Object []输入,Object []&输出)在System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&rpc)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5( System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&rpc)位于System.ServiceModel.Dispatcher.MessageRpc.Process(布尔isOperationContextSet)

This doesn't seem to have anything to do with the Healthvault code, so I'm assuming that it's related to the WCF service. 这似乎与Healthvault代码没有任何关系,所以我假设它与WCF服务有关。 What I can't figure out is what changes between my local dev environment and Azure. 我不知道本地开发环境和Azure之间有什么变化。 Regardless, here is my web.config file 无论如何,这是我的web.config文件

<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          name="AzureDiagnostics">
          <filter type="" />
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
 <system.serviceModel>
   <services>
     <service name="myIHM.Healthvault">
       <endpoint address="" binding="webHttpBinding" contract="myIHM.IHealthvault" behaviorConfiguration="webHttp" />
     </service>
   </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- 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="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttp">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <appSettings>
    <add key="ApplicationId" value="[my-app-id]"/>
    <add key="ShellUrl" value="https://account.healthvault-ppe.com/"/>
    <add key="HealthServiceUrl" value="https://platform.healthvault-ppe.com/platform/"/>
    <add key="AppCertSubject" value="[my-cert-subject]"/>
  </appSettings>
</configuration>

I've looked around for some answers but I can't seem to find anything that pertains to my situation. 我到处寻找一些答案,但似乎找不到与我的情况有关的任何东西。 Does anyone have any recommendations? 有人有什么建议吗? Thanks. 谢谢。

One thing to be aware of is that you have more permissions when running in development fabric than you do in Cloud fabric. 要注意的一件事是,与在Cloud Fabric中相比,在Development Fabric中运行时您具有更多的权限。 SO it's not too uncommon to have things work in development fabric and then run into permission errors in the Cloud; 因此,让事情在开发结构中运行然后在云中遇到权限错误并不少见。 a bummer, I know. 我真是个无赖。 You can try to get the server logs using eg Azure Diagnostics Manager ( http://www.cerebrata.com/Products/AzureDiagnosticsManager/Default.aspx ) which has a free trial. 您可以尝试使用例如具有免费试用版的Azure Diagnostics Manager( http://www.cerebrata.com/Products/AzureDiagnosticsManager/Default.aspx )获取服务器日志。 That might provide you with more details on exactly what is failing. 这可能会为您提供有关失败原因的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Service托管的WCF服务在尝试读取文件时获得“访问被拒绝” - Windows Service Hosted WCF Service Getting “Access Denied” When Trying To Read a File 运行 Windows 服务时拒绝访问 - Access Denied when running Windows Service Windows服务写入网络驱动器时获取访问被拒绝的异常 - Windows Service getting access denied exception while writing to Network Drive 获取“访问被拒绝。 (在HR8ULT中出现异常:0x80070005(E_ACCESSDENIED))在Windows 8 App中,在DispatchTimer中使用Message对话框时? - Getting “Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))” in Windows 8 App when using Message dialog in DispatchTimer? WCF访问被拒绝异常 - WCF Access is denied Exception 错误 5:启动 Windows 服务时拒绝访问 - Error 5 : Access Denied when starting windows service 如何在Windows Azure上运行的WCF服务中返回文件? - How to return file in WCF service running on Windows Azure? Windows Azure云服务-拒绝访问已部署的xml文件 - Windows Azure Cloud Service - Access to deployed xml file denied 从Windows服务以用户身份运行但访问失败的进程正在被拒绝? - Running process as a user from windows service failing with Access is Denied? 通过Windows服务运行时,我的WCF服务抛出错误 - My WCF service is throwing Error when running through a windows service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM