2003-11-08 04:52:42 -05:00
|
|
|
#!/usr/bin/env ruby
|
2003-11-28 00:53:16 -05:00
|
|
|
require 'RAAServant.rb'
|
|
|
|
|
2003-11-08 04:52:42 -05:00
|
|
|
require 'soap/rpc/standaloneServer'
|
|
|
|
|
|
|
|
class RAABaseServicePortType
|
|
|
|
MappingRegistry = SOAP::Mapping::Registry.new
|
|
|
|
|
|
|
|
MappingRegistry.set(
|
|
|
|
StringArray,
|
|
|
|
::SOAP::SOAPArray,
|
|
|
|
::SOAP::Mapping::Registry::TypedArrayFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
|
|
|
|
)
|
|
|
|
MappingRegistry.set(
|
|
|
|
Map,
|
2003-11-28 00:53:16 -05:00
|
|
|
::SOAP::SOAPArray,
|
|
|
|
::SOAP::Mapping::Registry::TypedArrayFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") }
|
2003-11-08 04:52:42 -05:00
|
|
|
)
|
|
|
|
MappingRegistry.set(
|
|
|
|
Category,
|
|
|
|
::SOAP::SOAPStruct,
|
|
|
|
::SOAP::Mapping::Registry::TypedStructFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
|
|
|
|
)
|
|
|
|
MappingRegistry.set(
|
|
|
|
InfoArray,
|
|
|
|
::SOAP::SOAPArray,
|
|
|
|
::SOAP::Mapping::Registry::TypedArrayFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
|
|
|
|
)
|
|
|
|
MappingRegistry.set(
|
|
|
|
Info,
|
|
|
|
::SOAP::SOAPStruct,
|
|
|
|
::SOAP::Mapping::Registry::TypedStructFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
|
|
|
|
)
|
|
|
|
MappingRegistry.set(
|
|
|
|
Product,
|
|
|
|
::SOAP::SOAPStruct,
|
|
|
|
::SOAP::Mapping::Registry::TypedStructFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
|
|
|
|
)
|
|
|
|
MappingRegistry.set(
|
|
|
|
Owner,
|
|
|
|
::SOAP::SOAPStruct,
|
|
|
|
::SOAP::Mapping::Registry::TypedStructFactory,
|
|
|
|
{ :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
|
|
|
|
)
|
2003-11-28 00:53:16 -05:00
|
|
|
|
|
|
|
|
2003-11-08 04:52:42 -05:00
|
|
|
Methods = [
|
|
|
|
["getAllListings", "getAllListings", [
|
|
|
|
["retval", "return",
|
2003-11-28 00:53:16 -05:00
|
|
|
[::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
2003-11-08 04:52:42 -05:00
|
|
|
["getProductTree", "getProductTree", [
|
|
|
|
["retval", "return",
|
2003-11-28 00:53:16 -05:00
|
|
|
[::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
2003-11-08 04:52:42 -05:00
|
|
|
["getInfoFromCategory", "getInfoFromCategory", [
|
|
|
|
["in", "category",
|
|
|
|
[::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
|
|
|
|
["retval", "return",
|
2003-11-28 00:53:16 -05:00
|
|
|
[::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
2003-11-08 04:52:42 -05:00
|
|
|
["getModifiedInfoSince", "getModifiedInfoSince", [
|
|
|
|
["in", "timeInstant",
|
|
|
|
[SOAP::SOAPDateTime]],
|
|
|
|
["retval", "return",
|
2003-11-28 00:53:16 -05:00
|
|
|
[::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
2003-11-08 04:52:42 -05:00
|
|
|
["getInfoFromName", "getInfoFromName", [
|
|
|
|
["in", "productName",
|
|
|
|
[SOAP::SOAPString]],
|
|
|
|
["retval", "return",
|
2003-11-28 00:53:16 -05:00
|
|
|
[::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
2003-11-08 04:52:42 -05:00
|
|
|
["getInfoFromOwnerId", "getInfoFromOwnerId", [
|
|
|
|
["in", "ownerId",
|
|
|
|
[SOAP::SOAPInt]],
|
|
|
|
["retval", "return",
|
2003-11-28 00:53:16 -05:00
|
|
|
[::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"]
|
2003-11-08 04:52:42 -05:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2003-11-28 00:53:16 -05:00
|
|
|
class App < SOAP::RPC::StandaloneServer
|
2003-11-08 04:52:42 -05:00
|
|
|
def initialize(*arg)
|
|
|
|
super
|
|
|
|
|
|
|
|
servant = RAABaseServicePortType.new
|
|
|
|
RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
|
|
|
|
qname = XSD::QName.new(namespace, name_as)
|
|
|
|
@soaplet.app_scope_router.add_method(servant, qname, soapaction,
|
|
|
|
name, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
self.mapping_registry = RAABaseServicePortType::MappingRegistry
|
|
|
|
end
|
|
|
|
end
|
2003-11-28 00:53:16 -05:00
|
|
|
|
|
|
|
# Change listen port.
|
|
|
|
if $0 == __FILE__
|
|
|
|
App.new('app', nil, '0.0.0.0', 10080).start
|
|
|
|
end
|