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

root/trunk/test/wsdl/raa/expectedMappingRegistry.rb

Revision 1979, 4.5 kB (checked in by nahi, 1 year ago)
  • when there are 2 unqualified anonymous elements which have the same name in a SOAP message, mapper cannot decode it to the correct object. introduced :is_anonymous in mapping_registry and do not search registry with anonymous element. closes #355.
Line 
1 require 'RAA.rb'
2 require 'soap/mapping'
3
4 module WSDL; module RAA
5
6 module RAAMappingRegistry
7   EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
8   LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
9   NsC_002 = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
10
11   EncodedRegistry.register(
12     :class => WSDL::RAA::Category,
13     :schema_type => XSD::QName.new(NsC_002, "Category"),
14     :schema_element => [
15       ["major", ["SOAP::SOAPString", XSD::QName.new(nil, "major")]],
16       ["minor", ["SOAP::SOAPString", XSD::QName.new(nil, "minor")]]
17     ]
18   )
19
20   EncodedRegistry.register(
21     :class => WSDL::RAA::Product,
22     :schema_type => XSD::QName.new(NsC_002, "Product"),
23     :schema_element => [
24       ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]],
25       ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
26       ["short_description", ["SOAP::SOAPString", XSD::QName.new(nil, "short_description")]],
27       ["version", ["SOAP::SOAPString", XSD::QName.new(nil, "version")]],
28       ["status", ["SOAP::SOAPString", XSD::QName.new(nil, "status")]],
29       ["homepage", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "homepage")]],
30       ["download", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "download")]],
31       ["license", ["SOAP::SOAPString", XSD::QName.new(nil, "license")]],
32       ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]]
33     ]
34   )
35
36   EncodedRegistry.register(
37     :class => WSDL::RAA::Owner,
38     :schema_type => XSD::QName.new(NsC_002, "Owner"),
39     :schema_element => [
40       ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]],
41       ["email", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "email")]],
42       ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]]
43     ]
44   )
45
46   EncodedRegistry.register(
47     :class => WSDL::RAA::Info,
48     :schema_type => XSD::QName.new(NsC_002, "Info"),
49     :schema_element => [
50       ["category", ["WSDL::RAA::Category", XSD::QName.new(nil, "category")]],
51       ["product", ["WSDL::RAA::Product", XSD::QName.new(nil, "product")]],
52       ["owner", ["WSDL::RAA::Owner", XSD::QName.new(nil, "owner")]],
53       ["created", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "created")]],
54       ["updated", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "updated")]]
55     ]
56   )
57
58   EncodedRegistry.set(
59     WSDL::RAA::InfoArray,
60     ::SOAP::SOAPArray,
61     ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory,
62     { :type => XSD::QName.new(NsC_002, "Info") }
63   )
64
65   EncodedRegistry.set(
66     WSDL::RAA::StringArray,
67     ::SOAP::SOAPArray,
68     ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory,
69     { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
70   )
71
72   LiteralRegistry.register(
73     :class => WSDL::RAA::Category,
74     :schema_type => XSD::QName.new(NsC_002, "Category"),
75     :schema_element => [
76       ["major", ["SOAP::SOAPString", XSD::QName.new(nil, "major")]],
77       ["minor", ["SOAP::SOAPString", XSD::QName.new(nil, "minor")]]
78     ]
79   )
80
81   LiteralRegistry.register(
82     :class => WSDL::RAA::Product,
83     :schema_type => XSD::QName.new(NsC_002, "Product"),
84     :schema_element => [
85       ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]],
86       ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
87       ["short_description", ["SOAP::SOAPString", XSD::QName.new(nil, "short_description")]],
88       ["version", ["SOAP::SOAPString", XSD::QName.new(nil, "version")]],
89       ["status", ["SOAP::SOAPString", XSD::QName.new(nil, "status")]],
90       ["homepage", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "homepage")]],
91       ["download", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "download")]],
92       ["license", ["SOAP::SOAPString", XSD::QName.new(nil, "license")]],
93       ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]]
94     ]
95   )
96
97   LiteralRegistry.register(
98     :class => WSDL::RAA::Owner,
99     :schema_type => XSD::QName.new(NsC_002, "Owner"),
100     :schema_element => [
101       ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]],
102       ["email", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "email")]],
103       ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]]
104     ]
105   )
106
107   LiteralRegistry.register(
108     :class => WSDL::RAA::Info,
109     :schema_type => XSD::QName.new(NsC_002, "Info"),
110     :schema_element => [
111       ["category", ["WSDL::RAA::Category", XSD::QName.new(nil, "category")]],
112       ["product", ["WSDL::RAA::Product", XSD::QName.new(nil, "product")]],
113       ["owner", ["WSDL::RAA::Owner", XSD::QName.new(nil, "owner")]],
114       ["created", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "created")]],
115       ["updated", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "updated")]]
116     ]
117   )
118
119 end
120
121 end; end
Note: See TracBrowser for help on using the browser.