Hi there,
I've been battling with passing null values on boolean fields to a web service, and this exchange seemed so promising... but unfortunately I'm still stuck! This is what I'm doing:
Node.SetValue(string.Empty);
Node.MoveToFirstChild();
Node.DeleteSelf();
Node.CreateAttribute("xsi", "nil", System.Xml.Schema.XmlSchema.InstanceNamespace, "true");
In some cases the node had more than one child, but made sure they were all deleted;
For the namespace, I tried explicitly using "http://www.w3.org/2001/XMLSchema-instance", using InstanceNamespace as above, and also node.NamespaceName - none made a difference
Does anybody have any other ideas about what could be stopping this working?
As a different approach I've tried replacing the entire node, e.g.
Node.ReplaceSelf(string.Format("<{0} xsi:nil='true'/>", Node.Name));
But that results in the error "'xsi' is an undeclared prefix"
Starting to lose the will to live, and much to the chagrin of my data and .Net-focused colleagues, considering setting all the web service fields to strings just so InfoPath can handle them... which is not a great story!
Thanks,
Poolio