How to set a SOAP object to nil

Hi,

we are using SOAP::WSDLDriverFactory and creating an rpc driver based on
a WSDL file.

We have a complex type that we want to be able to set to nil or null in
the soap request.

In order to make this more dynamic we create a object whose instance
variable map to one of the elements in the WSDL file.

So say there is a complex type of Accountant within another complex type
of Applicant and Accountant has a number of different fields.

(NOTE: Example below has been cut down to give you the basic idea)

<xsd:complexType name=“ApplicantTO”>
xsd:sequence
<xsd:element minOccurs=“0” name=“accountant” nillable=“true”
type=“ns1:AccountantTO” />

</xsd:complexType>

<xsd:complexType name=“AccountantTO”>
xsd:sequence
<xsd:element minOccurs=“0” name=“accountantFigures”
nillable=“true” type=“xsd:int” />
<xsd:element minOccurs=“0” name=“company” nillable=“true”
type=“xsd:string” />
<xsd:element minOccurs=“0” name=“name” nillable=“true”
type=“xsd:string” />
</xsd:sequence>
</xsd:complexType>

<xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema
attributeFormDefault=“qualified” elementFormDefault=“qualified”
targetNamespace=“myURL”>
<xsd:element name=“submitPreapproval”>
xsd:complexType
xsd:sequence
<xsd:element maxOccurs=“1” minOccurs=“1” name=“in0”
nillable=“true” type=“ns1:ApplicantTO” />
</xsd:sequence>

</xsd:complexType>

</xsd:element>
<xsd:element name=“submitPreapprovalResponse”>
xsd:complexType
xsd:sequence
<xsd:element maxOccurs=“1” minOccurs=“1” name=“out”
nillable=“true” type=“xsd:int” />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

so if I have object 1 with in0 set as an instance variable

object 1
@in0 = object 2

and object 2 with no instance variables set (so no accountant set)

object 2

when I call rpc_driver.submitPreapproval(object 1) I would expect that
the soap request has accountant set to null.

Instead I find that it has an accountant complextype with blank strings
for all it’s fields.

Is there something I need to know to make sure accountant is sent down
the line as null?

Any help would be appreciated

Steve

Did you find a solution to this one? I’m experiencing exactly the same
error.