代码之家  ›  专栏  ›  技术社区  ›  urig

当TFS 2010向WCF 4.0服务发送SOAP警报时发生404错误

  •  1
  • urig  · 技术社区  · 14 年前

    我正在尝试编写一个WCF 4.0服务,它将从TFS 2010接收SOAP警报。这是我的服务合同:

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

    我正在为我的服务端点使用此绑定配置:

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

     Notification not delivered.
     Notification: WorkItemChangedEvent (DeliveryType: Soap; Address: http://192.168.10.10/TrafficLight/Service1.svc)
     Exception: Microsoft.TeamFoundation.TeamFoundationServiceUnavailableException: Team Foundation services are not available from server http://192.168.10.10/TrafficLight/Service1.svc.  Technical information (for administrator):
     HTTP code 404: Not Found ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
      at System.Net.HttpWebRequest.GetResponse()
      at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.AsyncWebRequest.ExecRequest(Object obj)
      --- End of inner exception stack trace ---
      at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.ProcessHttpResponse(HttpWebResponse response, Stream responseStream, WebException webException, XmlReader& xmlResponseReader)
      at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.ExecWebServiceRequest(HttpWebRequest request, XmlWriter requestXml, String methodName, HttpWebResponse& response)
      at Microsoft.TeamFoundation.JobService.Extensions.Core.TeamFoundationNotificationClient.Notify(String eventXml, String tfsIdentityXml, Subscription subscription)
      at Microsoft.TeamFoundation.JobService.Extensions.Core.NotificationJobExtension.SendSoapNotification(TeamFoundationRequestContext requestContext, TeamFoundationNotification notification, TeamFoundationIdentityService identityService) 
    

    (这是从我的Tfs 2010安装的[Tfs_Configuration].[dbo].[tbl_JobHistory]表中获取的)

    奇怪的是,当我在运行TfsJobAgent的同一台机器上的internet explorer中尝试我的服务的URL时,我会收到标准的“You have created a service” 404错误。

    为什么TFS作业代理从我的服务接收404错误,而我的服务似乎配置正确?我怎样才能解决这个问题?

     [WebService(Namespace = "http://tempuri.org/")]
     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
     [System.ComponentModel.ToolboxItem(false)]
     public class WebService1 : System.Web.Services.WebService
     {
      [SoapDocumentMethod("http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify", RequestNamespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
      [WebMethod]
      public void Notify(string eventXml, string tfsIdentityXml)
      {
       // log incoming event...
      }
    
    1 回复  |  直到 14 年前
        1
  •  2
  •   Ewald Hofman    14 年前