Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to consume a webservice using a WSDL file. file has a complex type is like this ..

XML
<s:complexType name="ArrayOfTermsAndConditionsAcceptedElement">
       <s:sequence>
         <s:element minOccurs="0" maxOccurs="unbounded" name="TermsAndConditionsAcceptedElement" nillable="true" type="tns:TermsAndConditionsAcceptedElement" />
       </s:sequence>
     </s:complexType>
     <s:complexType name="TermsAndConditionsAcceptedElement">
       <s:sequence>
         <s:element minOccurs="0" maxOccurs="1" name="Name" type="tns:TermsAndConditionsIdentifier" />
         <s:element minOccurs="0" maxOccurs="1" name="Value" type="s:boolean"/>
       </s:sequence>
     </s:complexType>

     <s:simpleType name="TermsAndConditionsIdentifier">
       <s:list>
         <s:simpleType>
           <s:restriction base="s:string">
             <s:enumeration value="eReceipt" />
           </s:restriction>
         </s:simpleType>
       </s:list>
     </s:simpleType>



When converting this above WSDL file to a C# class, two properties coming as default .. along with my actual needy properties (TermsAndConditionsIdentifier and Value).

1, NameSpecified
2, ValueSpecified

Could any one explain why these specified properties are coming by default ?
Posted

1 solution

Hi All,

Specified property comes to override the behaviour of a class. Suppose the enumerate class defined as minoccurs and MaxOccurs is 0, then this case is forever false. like the above in WSDL if we mention bool value as minoccurs and MaxOccurs is 0, the statement is not correct. So, the auto generated classes of WSDL gives specified properties in those classes to override.

Regards,
Subbu - SKOTAJI.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900