mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
42bca643c3
* lib/soap/encodingstyle/soapHandler.rb, lib/soap/mapping/factory.rb, lib/soap/mapping/mapping.rb, lib/soap/mapping/registry.rb, lib/wsdl/soap/complexType.rb: ApacheSOAP's map support was broken under WSDL dynanic client environment. fixed. * test/wsdl/raa/*: add tests. * lib/xsd/datatypes.rb: dateTime precision bug fix (at least, I hope.) bug of soap4r. XSDDateTimeImple.to_time passed a Float to Time.local/Time.gm as an usec, and NUM2LONG(rb_num2long for Float) causes rounding error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
101 lines
3.8 KiB
Ruby
101 lines
3.8 KiB
Ruby
#!/usr/bin/env ruby
|
|
require 'RAAServant.rb'
|
|
|
|
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,
|
|
::SOAP::SOAPArray,
|
|
::SOAP::Mapping::Registry::TypedArrayFactory,
|
|
{ :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") }
|
|
)
|
|
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") }
|
|
)
|
|
|
|
|
|
Methods = [
|
|
["getAllListings", "getAllListings", [
|
|
["retval", "return",
|
|
[::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
|
["getProductTree", "getProductTree", [
|
|
["retval", "return",
|
|
[::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
|
|
["getInfoFromCategory", "getInfoFromCategory", [
|
|
["in", "category",
|
|
[::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
|
|
["retval", "return",
|
|
[::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/"],
|
|
["getModifiedInfoSince", "getModifiedInfoSince", [
|
|
["in", "timeInstant",
|
|
[SOAP::SOAPDateTime]],
|
|
["retval", "return",
|
|
[::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/"],
|
|
["getInfoFromName", "getInfoFromName", [
|
|
["in", "productName",
|
|
[SOAP::SOAPString]],
|
|
["retval", "return",
|
|
[::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/"],
|
|
["getInfoFromOwnerId", "getInfoFromOwnerId", [
|
|
["in", "ownerId",
|
|
[SOAP::SOAPInt]],
|
|
["retval", "return",
|
|
[::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/"]
|
|
]
|
|
end
|
|
|
|
class App < SOAP::RPC::StandaloneServer
|
|
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
|
|
|
|
# Change listen port.
|
|
if $0 == __FILE__
|
|
App.new('app', nil, '0.0.0.0', 10080).start
|
|
end
|