WCF ReplyAction ="*"打破元数据

Dom*_*ram 7 .net c# wcf web-services metadata

以下合同不会在元数据中生成操作,但如果我删除了回复操作或将其设置为"",则元数据现在可以正确生成操作.为什么?

[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);
}
Run Code Online (Sandbox Code Playgroud)

如果需要,完整服务代码在WCF元数据中缺少操作.

hay*_*eld 6

为OperationContract设置ReplyAction ="*"表示WsdlExporter(发布元数据)将忽略该操作.设置任何其他值将解决它.

  • 你也可以完全删除该属性,这应该仍然有效. (3认同)