2014-01-17 37 views
0

我有以下类别:NServiceBus与WCF在Azure上

namespace GAT.Cloud.Integration.WebServices { 
    public class DepartureUpdatedService : WcfService<DepartureUpdated, ErrorResponse> { 
    } 
} 

而且

namespace GAT.ESB.Messages.Integration { 
    [Serializable] 
    public class DepartureUpdated : ICommand { 
     public Departure Departure { get; set; } 
     public DepartureSeries DepartureSeries { get; set; } 
    } 
} 

而且

namespace GAT.Cloud.Integration.Responses { 
    public enum ErrorResponse { 
     None, 
     Fail 
    } 
} 

而且在App.config下面的代码片段

<system.serviceModel> 
    <services> 
     <service name="GAT.Cloud.Integration.WebServices.DepartureUpdatedService" behaviorConfiguration="Default"> 
      <endpoint address="http://<something>.cloudapp.net/WebHttpService/" binding="basicHttpBinding" contract="NServiceBus.IWcfService`2[[GAT.ESB.Messages.Integration.DepartureUpdated, GAT.ESB.Messages.Integration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GAT.Cloud.Integration.Responses.ErrorResponse, GAT.Cloud.Integration.Responses, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]" /> 
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />     
     </service> 
    </services> 

我得到两个错误:

The 'contract' attribute is invalid - The value 'NServiceBus.IWcfService`2[[GAT.ESB.Messages.Integration.DepartureUpdated, GAT.ESB.Messages.Integration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GAT.Cloud.Integration.Responses.ErrorResponse, GAT.Cloud.Integration.Responses, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is invalid according to its datatype 'serviceContractType' - The Enumeration constraint failed. 

而且

The 'name' attribute is invalid - The value 'GAT.Cloud.Integration.WebServices.DepartureUpdatedService' is invalid according to its datatype 'serviceNameType' - The Enumeration constraint failed. 

我不知道什么是错。有人有任何想法吗?此外,这是否正确设置为在作为云服务发布到Azure时在http://<something>.cloudapp.net/WebHttpService/上显示?

回答

0

解决方案是终点。它应该是:

<endpoint address="" binding="basicHttpBinding" contract="NServiceBus.IWcfService`2[[GAT.ESB.Messages.Integration.DepartureUpdated, GAT.ESB.Messages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GAT.Cloud.Integration.Responses.ErrorResponse, GAT.Cloud.PhoenixIntegration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]" /> 
+0

我在哭,但我不知道为什么。 – Darren

+1

关于NServiceBus.IWcfService'2 [[GAT.ESB.Messages.Integration.DepartureUpdated,GAT.ESB.Messages.Integration,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null],[GAT.Cloud。 Integration.Responses.ErrorResponse,GAT.Cloud.Integration.Responses,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null]],这使得它有点......这个,反清理 –