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

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

Revision 1979, 2.1 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 'echo.rb'
2 require 'soap/mapping'
3
4 module WSDL; module Any
5
6 module EchoMappingRegistry
7   EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
8   LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
9   NsEchoType = "urn:example.com:echo-type"
10   NsXMLSchema = "http://www.w3.org/2001/XMLSchema"
11
12   EncodedRegistry.register(
13     :class => WSDL::Any::FooBar,
14     :schema_type => XSD::QName.new(NsEchoType, "foo.bar"),
15     :schema_element => [
16       ["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
17       ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
18       ["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]]
19     ]
20   )
21
22   LiteralRegistry.register(
23     :class => WSDL::Any::FooBar,
24     :schema_type => XSD::QName.new(NsEchoType, "foo.bar"),
25     :schema_element => [
26       ["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
27       ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
28       ["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]]
29     ]
30   )
31
32   LiteralRegistry.register(
33     :class => WSDL::Any::FooBar,
34     :schema_name => XSD::QName.new(NsEchoType, "foo.bar"),
35     :schema_element => [
36       ["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
37       ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
38       ["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]]
39     ]
40   )
41
42   LiteralRegistry.register(
43     :class => WSDL::Any::SetOutputAndCompleteRequest,
44     :schema_name => XSD::QName.new(NsEchoType, "setOutputAndCompleteRequest"),
45     :schema_element => [
46       ["taskId", ["SOAP::SOAPString", XSD::QName.new(nil, "taskId")]],
47       ["data", ["WSDL::Any::SetOutputAndCompleteRequest::C_Data", XSD::QName.new(nil, "data")]],
48       ["participantToken", ["SOAP::SOAPString", XSD::QName.new(nil, "participantToken")]]
49     ]
50   )
51
52   LiteralRegistry.register(
53     :class => WSDL::Any::SetOutputAndCompleteRequest::C_Data,
54     :schema_name => XSD::QName.new(nil, "data"),
55     :is_anonymous => true,
56     :schema_qualified => false,
57     :schema_element => [
58       ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]]
59     ]
60   )
61 end
62
63 end; end
Note: See TracBrowser for help on using the browser.