2

この質問はおそらく、TFS 2010 が SOAP アラートを WCF 4.0 サービスに送信するときの 404 エラーまたはこれと非常によく似て いますが、どこで間違ったのかわかりません。(だから、Ewaldがチャイムを鳴らしてくれることを願って)

見つけたすべてのサンプルと質問を調べましたが、どういうわけか、まだアラートが発生しません。

私のテスト実装は azure にデプロイされ、無料の tfs サービス (***.visualstudio.com) を構成して、新しい作業項目をそのエンドポイントに実際にポストしました。

自分でクライアント プロキシを作成すると、データが到着することがわかります。コード/構成にまだ何か問題があるのでしょうか?

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

    public class NotifyService : INotifyService
    {
        void INotifyService.Notify(string eventXml, string tfsIdentityXml)
        {
            using (var db = new NotificationContext())
            {
                db.Notifications.Add(new Notification { EventXml = eventXml, TfsIdendityXml = tfsIdentityXml });
                db.SaveChanges();
            }
        }
    }
}

web.config ファイル:

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="NotifyServiceBinding">
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="NotifyServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="NotifyServiceBehavior" name="Tfs.NotificationService.NotifyService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NotifyServiceBinding"
                  contract="Tfs.NotificationService.INotifyService" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

プロジェクトは ASP.Net MVC 4 - .Net 4.5 - データを格納するための EF 5.0 です。

4

1 に答える 1

3

作業ソリューション:

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

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class NotifyService : INotifyService
    {
        void INotifyService.Notify(string eventXml, string tfsIdentityXml)
        {
            // do something
        }
    }
}

Web.config:

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="NotifyServiceBinding">
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="NotifyServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="NotifyServiceBehavior" name="Tfs.NotificationService.NotifyService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NotifyServiceBinding"
                  contract="Tfs.NotificationService.INotifyService" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
于 2014-04-18T08:09:42.323 に答える