How can I force WCF to autogenerate WSDLs with required method parameters (minoccurs=“1”)?

后端 未结 2 1811
太阳男子
太阳男子 2020-12-05 11:03

While using WCF and OperationContracts I have the following method defined:

    [OperationContract]
    [FaultContract(typeof(ValidationFault))]
    [FaultCo         


        
2条回答
  •  暖寄归人
    2020-12-05 11:39

    Check that MyComplexType is marked with a [DataContract] attribute.

    For my own WCF contract, I found that minOccurs = 1 would not show up for IsRequired=true in the generated wsdl until the whole chain of objects implicated in the contract were marked as such.

提交回复
热议问题