How do I send null values in SOAP messages?

Some requests you can make have optional parameters, which should be set to null if you are passing no value for the parameter. In XML and SOAP a null value is signified by setting the nil attribute of the tag corresponding to the parameter. If you were making a request to a service about shipping that took three parameters: length, width, and weight, but the weight parameter was optional, the body of the request would look something like this:

<shippingRequest>
  <length>14</length>
  <width>8.2</width>
  <weight xsi:nil="true"/>
</shippingRequest>
Note that if you passed in
<weight></weight>
or
<weight/>
these would not be interpreted as null values, but rather as the empty string.

Some web services signify null by omission of the tag, but the AdSense API using the nil attribute.

Main menu
9379876203936343046
true
Search Help Center
true
true
true
false
false