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

« back to all changes in this revision

Viewing changes to test/wsdl/raa/server.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 'soap/rpc/standaloneServer'
3
 
require 'RAA.rb'
4
 
 
5
 
class RAABaseServicePortType
6
 
  MappingRegistry = SOAP::Mapping::Registry.new
7
 
 
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
 
  ]
85
 
 
86
 
  def getAllListings
87
 
    ["ruby", "soap4r"]
88
 
  end
89
 
end
90
 
 
91
 
class RAABaseServiceServer < SOAP::RPC::StandaloneServer
92
 
  def initialize(*arg)
93
 
    super
94
 
 
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
100
 
 
101
 
    self.mapping_registry = RAABaseServicePortType::MappingRegistry
102
 
  end
103
 
end