Visual Studio Online是否支持SOAP WorkItem更改通知?

时间:2014-04-17 17:26:46

标签: wcf azure-devops tfs-workitem

我问的原因是,我按照指南设置了WCF服务(具体如下),并在Visual Studio Online中设置了SOAP通知,似乎没有调用我的服务。 IIS 8。5日志显示没有尝试从VSO服务器与服务联系。

如果支持IS,这里有相关位,看看我是否在服务端设置了错误。

WCF服务 - 作为Azure WebRole托管的.NET 4.5.1

合同与实施

[ServiceContract(Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
public interface IWorkItemSubscriber
{
    [OperationContract(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify")]
    [XmlSerializerFormat(Style = OperationFormatStyle.Document)]
    void Notify(string eventXml, string tfsIdentityXml);
}

// Note, I've tried w/ and w/out this Compatibility Attribute
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class WorkItemSubscriber : IWorkItemSubscriber
{
    public void Notify(string eventXml, string tfsIdentityXml)
    {
        // Do stuff
    }
}

的Web.Config

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5.1" />
    <customErrors mode="Off"/>
  </system.web>

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="noSecurity">
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>

    <services>
      <service name="VsoNotificationService.Wcf.WorkItemSubscriber" behaviorConfiguration="eventServiceBehavior">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="noSecurity" contract="VsoNotificationService.Wcf.IWorkItemSubscriber" />
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="eventServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" aspNetCompatibilityEnabled="true" /> <!-- note: I've tried w/ and w/out the aspNetCompatibilityEnabled attribute -->
  </system.webServer>
</configuration>

Visual Studio在线配置

Screencap of VSO configuration

我已经确认我可以通过创建自己的客户端并调用该服务来启动服务。无论我在方法中放置什么代码,如果我通过Visual Studio 2013进行远程调试,我都会点击方法的断点。所以服务启动并运行,我只是看不到Visual Studio Online的流量(通过代码断点,代码内容,也不是IIS日志)。让我觉得这个功能在那里不起作用?

1 个答案:

答案 0 :(得分:0)

我发现你错过了aspNetCompatibilityEnabled="true"元素上的<serviceHostingEnvironment,与my working solution相比,它可能是这个难题的缺失部分?

我也只是通过仔细包括所有小配置设置来取得成功。