Class: WSDL::OperationBinding

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

Instance Attribute Summary collapse

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initializeOperationBinding

Returns a new instance of OperationBinding.



22
23
24
25
26
27
28
29
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 22

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

Instance Attribute Details

#faultObject (readonly)

Returns the value of attribute fault.



19
20
21
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 19

def fault
  @fault
end

#inputObject (readonly)

Returns the value of attribute input.



17
18
19
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 17

def input
  @input
end

#nameObject (readonly)

required



16
17
18
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 16

def name
  @name
end

#outputObject (readonly)

Returns the value of attribute output.



18
19
20
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 18

def output
  @output
end

#soapoperationObject (readonly)

Returns the value of attribute soapoperation.



20
21
22
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 20

def soapoperation
  @soapoperation
end

Instance Method Details

#find_operationObject



39
40
41
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 39

def find_operation
  porttype.operations[@name] or raise RuntimeError.new("#{@name} not found")
end

#parse_attr(attr, value) ⇒ Object



97
98
99
100
101
102
103
104
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 97

def parse_attr(attr, value)
  case attr
  when NameAttrName
    @name = XSD::QName.new(targetnamespace, value.source)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



71
72
73
74
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/operationBinding.rb', line 71

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 SOAPOperationName
    o = WSDL::SOAP::Operation.new
    @soapoperation = o
    o
  when DocumentationName
    o = Documentation.new
    o
  else
    nil
  end
end

#porttypeObject



35
36
37
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 35

def porttype
  root.porttype(parent.type)
end

#soapactionObject



63
64
65
66
67
68
69
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 63

def soapaction
  if @soapoperation
    @soapoperation.soapaction
  else
    nil
  end
end

#soapoperation_nameObject



43
44
45
46
47
48
49
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 43

def soapoperation_name
  if @soapoperation
    @soapoperation.input_info.op_name
  else
    find_operation.name
  end
end

#soapoperation_styleObject



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/action_web_service/wsdl/operationBinding.rb', line 51

def soapoperation_style
  style = nil
  if @soapoperation
    style = @soapoperation.operation_style
  elsif parent.soapbinding
    style = parent.soapbinding.style
  else
    raise TypeError.new("operation style definition not found")
  end
  style || :document
end

#targetnamespaceObject



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

def targetnamespace
  parent.targetnamespace
end