While using WCF and OperationContracts I have the following method defined:
[OperationContract]
[FaultContract(typeof(ValidationFault))]
[FaultContract(typeof(FaultException<ExceptionDetail>))]
int DoSomething(int someId, MyComplexType messageData);
When this gets translated to a WSDL by the WCF runtime, it ends up with with minoccurs="0" listed for the parameters someId and messageData (and subsequently throws a runtime error if these parameters are missing).
If I generate a proxy using SoapUI I get something that looks like this:
<com:DoSomething>
<!--Optional-->
<com:EventId>1</com:EventId>
<!--Optional-->
<com:myComplexType >
<com:id>1</com:id>
</com:myComplexType >
</com:DoSomething>
The id field in MyComplexType is marked up with DataMemeber attribute using IsRequired="true" and thus is exposed as mandatory.
It's obviously quite misleading for the WSDL to specify that a parameter is optional when it isn't, but I can't see any obvious way to markup the OperationContract to force WCF to recognise and expose these parameters as required.
I'm slightly baffled there doesn't seem an obvious way to do this (reading intellisense / msdn / google). Or I'm going blind and overlooking something obvious.
Any clues?