Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
How to set a SOAP object to nil
Steve Vanspall
12/14/2007 5:53:00 AM
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/XMLSc...
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
--
Posted via
http://www.ruby-...
.
1 Answer
Wouter De bie
5/15/2009 2:30:00 PM
0
Did you find a solution to this one? I'm experiencing exactly the same
error.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
How to set a SOAP object to nil
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password