~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to test/wsdl/raa/RAAService.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env ruby
2
 
require 'RAAServant.rb'
3
 
 
4
 
require 'soap/rpc/standaloneServer'
5
 
 
6
 
class RAABaseServicePortType
7
 
  MappingRegistry = SOAP::Mapping::Registry.new
8
 
 
9
 
  MappingRegistry.set(
10
 
    StringArray,
11
 
    ::SOAP::SOAPArray,
12
 
    ::SOAP::Mapping::Registry::TypedArrayFactory,
13
 
    { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
14
 
  )
15
 
  MappingRegistry.set(
16
 
    Map,
17
 
    ::SOAP::SOAPArray,
18
 
    ::SOAP::Mapping::Registry::TypedArrayFactory,
19
 
    { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") }
20
 
  )
21
 
  MappingRegistry.set(
22
 
    Category,
23
 
    ::SOAP::SOAPStruct,
24
 
    ::SOAP::Mapping::Registry::TypedStructFactory,
25
 
    { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
26
 
  )
27
 
  MappingRegistry.set(
28
 
    InfoArray,
29
 
    ::SOAP::SOAPArray,
30
 
    ::SOAP::Mapping::Registry::TypedArrayFactory,
31
 
    { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
32
 
  )
33
 
  MappingRegistry.set(
34
 
    Info,
35
 
    ::SOAP::SOAPStruct,
36
 
    ::SOAP::Mapping::Registry::TypedStructFactory,
37
 
    { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
38
 
  )
39
 
  MappingRegistry.set(
40
 
    Product,
41
 
    ::SOAP::SOAPStruct,
42
 
    ::SOAP::Mapping::Registry::TypedStructFactory,
43
 
    { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
44
 
  )
45
 
  MappingRegistry.set(
46
 
    Owner,
47
 
    ::SOAP::SOAPStruct,
48
 
    ::SOAP::Mapping::Registry::TypedStructFactory,
49
 
    { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
50
 
  )
51
 
 
52
 
 
53
 
  Methods = [
54
 
    ["getAllListings", "getAllListings", [
55
 
      ["retval", "return",
56
 
       [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
57
 
    ["getProductTree", "getProductTree", [
58
 
      ["retval", "return",
59
 
       [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]]], "", "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"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
65
 
    ["getModifiedInfoSince", "getModifiedInfoSince", [
66
 
      ["in", "timeInstant",
67
 
       [SOAP::SOAPDateTime]],
68
 
      ["retval", "return",
69
 
       [::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/"],
70
 
    ["getInfoFromName", "getInfoFromName", [
71
 
      ["in", "productName",
72
 
       [SOAP::SOAPString]],
73
 
      ["retval", "return",
74
 
       [::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/"],
75
 
    ["getInfoFromOwnerId", "getInfoFromOwnerId", [
76
 
      ["in", "ownerId",
77
 
       [SOAP::SOAPInt]],
78
 
      ["retval", "return",
79
 
       [::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/"]
80
 
  ]
81
 
end
82
 
 
83
 
class App < SOAP::RPC::StandaloneServer
84
 
  def initialize(*arg)
85
 
    super
86
 
 
87
 
    servant = RAABaseServicePortType.new
88
 
    RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
89
 
      qname = XSD::QName.new(namespace, name_as)
90
 
      @router.add_method(servant, qname, soapaction, name, params)
91
 
    end
92
 
 
93
 
    self.mapping_registry = RAABaseServicePortType::MappingRegistry
94
 
  end
95
 
end
96
 
 
97
 
# Change listen port.
98
 
if $0 == __FILE__
99
 
  App.new('app', nil, '0.0.0.0', 10080).start
100
 
end