class WSDL::Operation
Constants
- EMPTY
Attributes
fault[R]
input[R]
name[R]
output[R]
parameter_order[R]
type[R]
Public Class Methods
new()
click to toggle source
Calls superclass method
WSDL::Info::new
# File lib/wsdl/operation.rb, line 23 def initialize super @name = nil @type = nil @parameter_order = nil @input = nil @output = nil @fault = [] end
Public Instance Methods
inputname()
click to toggle source
# File lib/wsdl/operation.rb, line 51 def inputname if input as_operationname(input.name ? input.name.name : @name) else nil end end
inputparts()
click to toggle source
TODO: remove once after OperationInfo created
# File lib/wsdl/operation.rb, line 43 def inputparts if message = input_message sort_parts(message.parts) else EMPTY end end
operationname()
click to toggle source
# File lib/wsdl/operation.rb, line 37 def operationname as_operationname(@name) end
outputname()
click to toggle source
# File lib/wsdl/operation.rb, line 68 def outputname if output as_operationname(output.name ? output.name.name : @name + 'Response') else nil end end
outputparts()
click to toggle source
TODO: remove once after OperationInfo created
# File lib/wsdl/operation.rb, line 60 def outputparts if message = output_message sort_parts(message.parts) else EMPTY end end
parse_attr(attr, value)
click to toggle source
# File lib/wsdl/operation.rb, line 98 def parse_attr(attr, value) case attr when NameAttrName @name = value.source when TypeAttrName @type = value when ParameterOrderAttrName @parameter_order = value.source.split(/\s+/) else nil end end
parse_element(element)
click to toggle source
# File lib/wsdl/operation.rb, line 76 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
targetnamespace()
click to toggle source
# File lib/wsdl/operation.rb, line 33 def targetnamespace parent.targetnamespace end
Private Instance Methods
as_operationname(name)
click to toggle source
# File lib/wsdl/operation.rb, line 145 def as_operationname(name) XSD::QName.new(targetnamespace, name) end
input_message()
click to toggle source
# File lib/wsdl/operation.rb, line 113 def input_message if input and message = input.find_message message else nil end end
output_message()
click to toggle source
# File lib/wsdl/operation.rb, line 121 def output_message if output and message = output.find_message message else nil end end
sort_parts(parts)
click to toggle source
# File lib/wsdl/operation.rb, line 129 def sort_parts(parts) return parts.dup unless parameter_order result = [] parameter_order.each do |orderitem| if (ele = parts.find { |part| part.name == orderitem }) result << ele end end if result.length == 0 return parts.dup end # result length can be shorter than parts's. # return part must not be a part of the parameterOrder. result end