WCF元数据缺少操作

我有一个在Visual Studio中运行的简单Web服务。 如果我尝试查看元数据,则缺少有关操作的信息,因此svcutil会生成客户端代码,而无需任何方法。 我的设置有什么问题吗?

                         

接口:

  [System.ServiceModel.ServiceContractAttribute(Namespace="http://Test/Publish", ConfigurationName="IFCRPublish")] public interface IFCRPublish { // CODEGEN: Generating message contract since the operation PublishNotification is neither RPC nor document wrapped. [System.ServiceModel.OperationContractAttribute(Action="http://Test/PublishNotification", ReplyAction="*")] PublishNotificationResponse1 PublishNotification(PublishNotificationRequest1 request); } 

响应:

  [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] public partial class PublishNotificationResponse1 { [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://Test/PublishTypes", Order=0)] public PublishNotificationResponse PublishNotificationResponse; public PublishNotificationResponse1() { } public PublishNotificationResponse1(PublishNotificationResponse PublishNotificationResponse) { this.PublishNotificationResponse = PublishNotificationResponse; } } 

请求:

  [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] public partial class PublishNotificationRequest1 { [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://Test/PublishTypes", Order=0)] public PublishNotification PublishNotification; public PublishNotificationRequest1() { } public PublishNotificationRequest1(PublishNotification PublishNotification) { this.PublishNotification = PublishNotification; } } 

这是我收到的元数据:

           

我的手术去了哪里?

解决了它。 为OperationContract设置ReplyAction =“*”表示WsdlExporter(发布元数据)将忽略该操作。 设置任何其他值可以修复它。

令我困扰的是,svcutil默认将replyaction设置为*,这意味着默认情况下svcutil会创建有效破坏元数据的服务。

尝试从你的enpoint的地址删除FCRPublish …你的mex端点在那里似乎没问题,所以我相信它应该工作