This is an example of the Web Service request payload for each allowed Default Value Behavior for an optional and nillable WSDL definition.

In this example we'll use the 'Address' attribute.

WSDL

<xs:complexType name="Customer">

<xs:sequence>

<xs:element name="Id" type="xs:integer" minOccurs="1">

<xs:element name="Name" type="xs:string" minOccurs="1">

<xs:element name="Company" type="xs:string" minOccurs="1">

<xs:element name="IdCard" type=”xs:string” minOccurs="1" nillable=”true”>

<xs:element name="Phone" type=”xs:string” minOccurs="0">  

<xs:element name="Address" type=”xs:string” minOccurs="0" nillable=”true”>  

<xs:sequence>

</xs:complexType>

Data to Send

Customer

Id

1

 

Name

"John Doe"

 

Company

"TransLand"

 

IdCard

"82749928"

 

Phone

"982363251"

 

Address

""

Default Value

Payload

In this case there are two possible values for the Default Value Behavior property:

Send: the default value is sent in the payload.

<Customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<Id>1</Id>

<Name>John Doe</Name>

<Company>TransLand</Company>

<IdCard>82749928</IdCard>

<Phone>982363251</Phone>

<Address></Address>  

</Customer>

Don't Send: the default value is not sent in the payload

<Customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<Id>1</Id>

<Name>John Doe</Name>

<Company>TransLand</Company>

<IdCard>82749928</IdCard>

<Phone>982363251</Phone>

</Customer>

Send Nil: the nil value is sent in the payload instead of the default value.

<Customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<Id>1</Id>

<Name>John Doe</Name>

<Company>TransLand</Company>

<IdCard>82749928</IdCard>

<Phone>982363251</Phone>

<Address xsi:nil="true"/>  

</Customer>