I prepared WCF service according to spec I've get. It works OK. I have one method, decorated with [OperationContract] called Search.
It looks like this (I've changed custom types names, but it doesn't matter) :
SearchResult Search(SearchCritery searchCritery, string connectionWith);
After that I get wsdl, which is OK too. But, one thing is wrong :
<xs:element name="Search">
<xs:complexType>
<xs:sequence>
<xs:element type="q1:SearchCritery" name="searchCritery" nillable="true" minOccurs="0" xmlns:q1="someCustomSchema"/>
<xs:element type="xs:string" name="connectionWith" nillable="true" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
as you can see, both input paramteres are marked as nillable and not required. What can I do, to change in my code to make them required and not nullable. Of course I'm checking in my code if they aren't and return appropriate info about it, but I must show in wsdl that. Another thing is, that I can't change this method and params declaration (types etc.)
Any help will be valuable.
EDITED: (DataContract added)
Filed names are simplified for question purpose
[DataContract]
public class SearchCritery
{
public SearchCritery()
{ }
[Power(6)]
[DataMember]
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 0)]
public string FieldA { get; set; }
[Power(5)]
[DataMember]
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 1)]
public string FieldB { get; set; }
[Power(1)]
[DataMember]
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 2)]
public string FieldC { get; set; }
[Power(5)]
[DataMember]
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 3)]
public string FieldD { get; set; }
}
As you see, the second parameters - string, isn't in Datacontract because I didn't know ho3 to add "only string" as data contract member.