Hi all,
When using wsdl and soap, I fail to get the contents of a second item
(an
array) in a struct across the wire. I see
<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema"
xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:AddObservation xmlns:n1=\"http://tempuri.org/">
<n1:ObserverSenderGUID>service@house:vision</n1:ObserverSenderGUID>
<n1:ObservationEvents>
</n1:ObservationEvents>
</n1:AddObservation>
</env:Body>
</env:Envelope>
as you can see the content of observationEvents is missing.
If I dump the Observation w/ SOAPMarshall, I see this
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<Observation xmlns:n1="http://www.ruby-lang.org/xmlns/ruby/type/1.6"
xsi:type="n1:Struct"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<type="xsd:string">Observation</type>
<member>
<observerSenderGUID
xsi:type="xsd:string">service@house:vision</observerSenderGUID>
<observationEvents n2:arrayType="xsd:anyType[1]"
xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="n2:Array">
<item xsi:type="n1:Struct">
<type xsi:type="xsd:string">ObservationEvent</type>
<member>
<observerStationGUID
xsi:type="xsd:string">
service@house:vision
</observerStationGUID>
....
where the observationEvents are available, but as "anyType". What I want
(i.e.
given as an example for the service that should work), is this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddObservation xmlns="http://tempuri.org/">
<ObserverSenderGUID>string</ObserverSenderGUID>
<ObservationEvents>
<ObservationEvent>
<ObserverStationGUID>string</ObserverStationGUID>
.....
I have absolutely no idea how to obtain this.
The marshalled stuff is not what is going over the wire.
1) What's the difference between the marshalled snippet and what is
going across the wire, anyway?
2) How do I pass the array?
ruby 1.8.3 (2005-09-21) [i486-linux]
(on debian testing)
Regards,
Kero.
The (simplified) code to produce the first two xml snippets this is:
require 'soap/marshal'
require 'soap/wsdlDriver'
require 'time'
server = "prc67241668"
port = 8080
service = "ILSA/ilsaservice.asmx"
url = "http://#{server}:#{port}/#{service}"
wsdl_url = "#{url}?WSDL"
client = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver
client.wiredump_dev = STDERR
Observation = Struct.new(:observerSenderGUID, :observationEvents)
class Observation
include SOAP::Marshallable
end
ObservationEvent = Struct.new(:observerStationGUID
# snip rest of fields
)
class ObservationEvent
include SOAP::Marshallable
end
# simplified string for c.l.r purposes
event1 = ObservationEvent.new("service@house:vision")
ary = [event1]
puts SOAP::Marshal.marshal(obs)
puts client.addObservation(
obs = Observation.new(
"urn:ilsa:service@house1.ilsa.com:vision-station-1",
ary
)
)