我有一个已通过 VS 2017 发布到 Azure 的 WCF 服务。我可以使用浏览器中的 URL 访问该服务,它按预期运行。该服务侦听来自 Salesforce 的出站消息。如果我发送一条消息,它会返回 404 错误。同样的服务可以正常发布到服务器上的 IIS。应用服务中是否有允许处理 POST 的设置?
更新:我认为问题可能出在 web.config 这是我所拥有的:
<system.serviceModel>
<bindings />
<client />
<services>
<service name="WorkflowNotificationServices.CaseNotificationService" behaviorConfiguration="debug">
<endpoint binding="basicHttpBinding" contract="CaseNotificationService" />
</service>
<service name="WorkflowNotificationServices.CommentNotificationService" behaviorConfiguration="CommentNotificationServiceBehavior">
<endpoint binding="basicHttpBinding" contract="CommentNotificationService" />
</service>
<service name="WorkflowNotificationServices.TaskNotificationService" behaviorConfiguration="TaskNotificationServiceBehavior">
<endpoint binding="basicHttpBinding" contract="TaskNotificationService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="CaseNotificationServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="CommentNotificationServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="TaskNotificationServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="debug">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
这在带有 IIS 的 VM 上运行良好。