Change soft-fail to use the config, rather than env
[rbx.git] / test / mri / wsdl / raa / server.rb
blob87bbc6f569f7e82133a2646c02bf36de4dc58aca
1 #!/usr/bin/env ruby
2 require 'soap/rpc/standaloneServer'
3 require 'RAA.rb'
5 class RAABaseServicePortType
6   MappingRegistry = SOAP::Mapping::Registry.new
8   MappingRegistry.set(
9     StringArray,
10     ::SOAP::SOAPArray,
11     ::SOAP::Mapping::Registry::TypedArrayFactory,
12     { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
13   )
14   MappingRegistry.set(
15     Map,
16     ::SOAP::SOAPStruct,
17     ::SOAP::Mapping::Registry::TypedStructFactory,
18     { :type => XSD::QName.new("http://xml.apache.org/xml-soap", "Map") }
19   )
20   MappingRegistry.set(
21     Category,
22     ::SOAP::SOAPStruct,
23     ::SOAP::Mapping::Registry::TypedStructFactory,
24     { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
25   )
26   MappingRegistry.set(
27     InfoArray,
28     ::SOAP::SOAPArray,
29     ::SOAP::Mapping::Registry::TypedArrayFactory,
30     { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
31   )
32   MappingRegistry.set(
33     Info,
34     ::SOAP::SOAPStruct,
35     ::SOAP::Mapping::Registry::TypedStructFactory,
36     { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
37   )
38   MappingRegistry.set(
39     Product,
40     ::SOAP::SOAPStruct,
41     ::SOAP::Mapping::Registry::TypedStructFactory,
42     { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
43   )
44   MappingRegistry.set(
45     Owner,
46     ::SOAP::SOAPStruct,
47     ::SOAP::Mapping::Registry::TypedStructFactory,
48     { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
49   )
50   
51   Methods = [
52     ["getAllListings", "getAllListings", [
53       ["retval", "return",
54        [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]],
55      "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
56     ["getProductTree", "getProductTree", [
57       ["retval", "return",
58        [::SOAP::SOAPStruct, "http://xml.apache.org/xml-soap", "Map"]]],
59      "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
60     ["getInfoFromCategory", "getInfoFromCategory", [
61       ["in", "category",
62        [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
63       ["retval", "return",
64        [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
65      "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
66     ["getModifiedInfoSince", "getModifiedInfoSince", [
67       ["in", "timeInstant",
68        [SOAP::SOAPDateTime]],
69       ["retval", "return",
70        [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
71      "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
72     ["getInfoFromName", "getInfoFromName", [
73       ["in", "productName",
74        [SOAP::SOAPString]],
75       ["retval", "return",
76        [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
77      "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
78     ["getInfoFromOwnerId", "getInfoFromOwnerId", [
79       ["in", "ownerId",
80        [SOAP::SOAPInt]],
81       ["retval", "return",
82        [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
83      "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"]
84   ]
86   def getAllListings
87     ["ruby", "soap4r"]
88   end
89 end
91 class RAABaseServiceServer < SOAP::RPC::StandaloneServer
92   def initialize(*arg)
93     super
95     servant = RAABaseServicePortType.new
96     RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
97       qname = XSD::QName.new(namespace, name_as)
98       @router.add_method(servant, qname, soapaction, name, params)
99     end
101     self.mapping_registry = RAABaseServicePortType::MappingRegistry
102   end