SOAP4R and ur-types

S

Scott Parkerson

Hello,

I am trying to implement a SOAP client in Ruby 1.8.1 that queries a
service and gets a response. I've followed NaHi's examples, and have
had some success until I query the service and the response is an
array of ur-types. Then, my program crashes horribly.

Below is the response off the wire. All names of SOAP methods and
stuff have been changed and/or mangled to protect the innocent (CYA on
my NDA, natch):

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<m:GetThingiesResponse xmlns:m="FooAPI">
<count xsi:type="xsd:int">2</count>
<Thingies SOAP-ENC:arrayType="xsd:ur-type[2]" xsi:type="SOAP-ENC:Array">
<Thingy>
<id xsi:type="xsd:int">111111</id>
<name xsi:type="xsd:string">Thing #1</name>
</Thingy>
<Thingy>
<id xsi:type="xsd:int">111112</id>
<name xsi:type="xsd:string">Thing #2</name>
</Thingy>
</Thingies>
</m:GetThingiesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

----

Here's the code:

require 'soap/rpc/driver'

server = "http://someplace.com/soap"
namespace = "FooAPI"
wiredump = STDERR

drv = SOAP::RPC::Driver.new( server, namespace )
drv.wiredump_dev = wiredump
drv.add_method( "GetThingies", "arg1", "arg2" )

p drv.GetThingies( 0, 1 )

----

And here is the stack trace I'm getting:

/usr/local/lib/ruby/1.8/soap/mapping/mapping.rb:157:in
`const_defined?': wrong constant name Ur-type (NameError)
from /usr/local/lib/ruby/1.8/soap/mapping/mapping.rb:157:in
`class_from_name'
from /usr/local/lib/ruby/1.8/soap/mapping/mapping.rb:156:in `each'
from /usr/local/lib/ruby/1.8/soap/mapping/mapping.rb:156:in
`class_from_name'
from /usr/local/lib/ruby/1.8/soap/mapping/rubytypeFactory.rb:404:in
`unknownstruct2obj'
from /usr/local/lib/ruby/1.8/soap/mapping/rubytypeFactory.rb:385:in
`unknowntype2obj'
from /usr/local/lib/ruby/1.8/soap/mapping/rubytypeFactory.rb:237:in
`soap2obj'
from /usr/local/lib/ruby/1.8/soap/mapping/registry.rb:386:in `_soap2obj'
from /usr/local/lib/ruby/1.8/soap/mapping/registry.rb:323:in `soap2obj'
... 16 levels...
from /usr/local/lib/ruby/1.8/soap/rpc/driver.rb:201:in `collect'
from /usr/local/lib/ruby/1.8/soap/rpc/driver.rb:201:in `call'
from (eval):2:in `GetThingies'
from thingy_test.rb:11


Any ideas? Is this where I roll up my sleeves and use the mapping
registry? And, if so, how? (And yes, I've read this already:
http://rrr.jin.gr.jp/rwiki?cmd=view;name=soap4r:How+I+might+use+mysterious+mappingRegistry)

Thanks,
Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top