Me pregunto cómo puedo especificar un parámetro de un método OperationContract en WCF según sea necesario para que el xsd generado contenga minOccurs = "1" en lugar de minOccurs = "0".Cómo especificar un parámetro de OperationContract según sea necesario
Ejemplo:
[ServiceContract(Namespace = "http://myUrl.com")]
public interface IMyWebService
{
[OperationContract]
string DoSomething(string param1, string param2, string param3);
}
genera este xsd:
<xs:element name="DoSomething">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="param1" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="param2" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="param3" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
Pero quiero definir minOcurrencias = "1" en el código sin la necesidad de fijar manualmente en el archivo xsd.
http: // stackoverflow .com/questions/1438623/how-can-i-force-wcf-to-autogenerate-wsdls-with-required-method-parameters-minoc/3436039 # 3436039 – Freelancer
Ver [aquí] (http://stackoverflow.com/ preguntas/1438623/how-can-i-force-wcf-to-autogenerate-wsdls-with-required-method-parameters-minocc/3436039 # 3436039) Me adelgazo k que es una mejor solución. –