Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/branches/1_5/sample/marshal/customregistry.rb

Revision 1929, 426 bytes (checked in by nahi, 1 year ago)
  • added customregistry sample.
Line 
1 require 'soap/marshal'
2
3 class IntArray < Array; end
4
5 map = SOAP::Mapping::Registry.new
6 map.add(
7   IntArray, SOAP::SOAPArray, SOAP::Mapping::Registry::TypedArrayFactory,
8   {
9     :type => XSD::QName.new(XSD::Namespace, XSD::IntLiteral)
10   }
11 )
12
13 puts "== dumps anyType array =="
14 puts SOAP::Marshal.marshal(IntArray[1, 2, 3])
15 puts
16 puts "== dumps int array with custom registry =="
17 puts SOAP::Marshal.marshal(IntArray[1, 2, 3], map)
Note: See TracBrowser for help on using the browser.