Class: WSDL::Operation

Inherits:
Info show all
Defined in:
lib/action_web_service/wsdl/operation.rb

Defined Under Namespace

Classes: NameInfo

Instance Attribute Summary collapse

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initializeOperation

Returns a new instance of Operation.



34
35
36
37
38
39
40
41
42
# File 'lib/action_web_service/wsdl/operation.rb', line 34

def initialize
  super
  @name = nil
  @type = nil
  @parameter_order = nil
  @input = nil
  @output = nil
  @fault = []
end

Instance Attribute Details

#faultObject (readonly)

Returns the value of attribute fault.



31
32
33
# File 'lib/action_web_service/wsdl/operation.rb', line 31

def fault
  @fault
end

#inputObject (readonly)

Returns the value of attribute input.



29
30
31
# File 'lib/action_web_service/wsdl/operation.rb', line 29

def input
  @input
end

#nameObject (readonly)

required



27
28
29
# File 'lib/action_web_service/wsdl/operation.rb', line 27

def name
  @name
end

#outputObject (readonly)

Returns the value of attribute output.



30
31
32
# File 'lib/action_web_service/wsdl/operation.rb', line 30

def output
  @output
end

#parameter_orderObject (readonly)

optional



28
29
30
# File 'lib/action_web_service/wsdl/operation.rb', line 28

def parameter_order
  @parameter_order
end

#typeObject (readonly)

required



32
33
34
# File 'lib/action_web_service/wsdl/operation.rb', line 32

def type
  @type
end

Instance Method Details

#input_infoObject



48
49
50
51
# File 'lib/action_web_service/wsdl/operation.rb', line 48

def input_info
  typename = input.find_message.name
  NameInfo.new(@name, typename, inputparts)
end

#inputnameObject



62
63
64
# File 'lib/action_web_service/wsdl/operation.rb', line 62

def inputname
  XSD::QName.new(targetnamespace, input.name ? input.name.name : @name.name)
end

#inputpartsObject



58
59
60
# File 'lib/action_web_service/wsdl/operation.rb', line 58

def inputparts
  sort_parts(input.find_message.parts)
end

#output_infoObject



53
54
55
56
# File 'lib/action_web_service/wsdl/operation.rb', line 53

def output_info
  typename = output.find_message.name
  NameInfo.new(@name, typename, outputparts)
end

#outputnameObject



70
71
72
73
# File 'lib/action_web_service/wsdl/operation.rb', line 70

def outputname
  XSD::QName.new(targetnamespace,
    output.name ? output.name.name : @name.name + 'Response')
end

#outputpartsObject



66
67
68
# File 'lib/action_web_service/wsdl/operation.rb', line 66

def outputparts
  sort_parts(output.find_message.parts)
end

#parse_attr(attr, value) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/action_web_service/wsdl/operation.rb', line 97

def parse_attr(attr, value)
  case attr
  when NameAttrName
    @name = XSD::QName.new(targetnamespace, value.source)
  when TypeAttrName
    @type = value
  when ParameterOrderAttrName
    @parameter_order = value.source.split(/\s+/)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/action_web_service/wsdl/operation.rb', line 75

def parse_element(element)
  case element
  when InputName
    o = Param.new
    @input = o
    o
  when OutputName
    o = Param.new
    @output = o
    o
  when FaultName
    o = Param.new
    @fault << o
    o
  when DocumentationName
    o = Documentation.new
    o
  else
    nil
  end
end

#targetnamespaceObject



44
45
46
# File 'lib/action_web_service/wsdl/operation.rb', line 44

def targetnamespace
  parent.targetnamespace
end