Class: WSDL::OperationBinding
- Inherits:
-
Info
show all
- Defined in:
- lib/wsdl/operationBinding.rb
Defined Under Namespace
Classes: BoundId, OperationInfo, Part
Instance Attribute Summary collapse
Attributes inherited from Info
#id, #parent, #root
Instance Method Summary
collapse
Methods inherited from Info
#inspect, #parse_epilogue
Constructor Details
Returns a new instance of OperationBinding.
78
79
80
81
82
83
84
85
|
# File 'lib/wsdl/operationBinding.rb', line 78
def initialize
super
@name = nil
@input = nil
@output = nil
@fault = []
@soapoperation = nil
end
|
Instance Attribute Details
Returns the value of attribute fault.
19
20
21
|
# File 'lib/wsdl/operationBinding.rb', line 19
def fault
@fault
end
|
Returns the value of attribute input.
17
18
19
|
# File 'lib/wsdl/operationBinding.rb', line 17
def input
@input
end
|
16
17
18
|
# File 'lib/wsdl/operationBinding.rb', line 16
def name
@name
end
|
Returns the value of attribute output.
18
19
20
|
# File 'lib/wsdl/operationBinding.rb', line 18
def output
@output
end
|
#soapoperation ⇒ Object
Returns the value of attribute soapoperation.
20
21
22
|
# File 'lib/wsdl/operationBinding.rb', line 20
def soapoperation
@soapoperation
end
|
Instance Method Details
121
122
123
|
# File 'lib/wsdl/operationBinding.rb', line 121
def boundid
BoundId.new(name, soapaction)
end
|
#find_operation ⇒ Object
125
126
127
128
129
130
131
132
133
134
135
|
# File 'lib/wsdl/operationBinding.rb', line 125
def find_operation
porttype.operations.each do |op|
next if op.name != @name
next if op.input and @input and op.input.name and @input.name and
op.input.name != @input.name
next if op.output and @output and op.output.name and @output.name and
op.output.name != @output.name
return op
end
raise RuntimeError.new("#{@name} not found")
end
|
#operation_info ⇒ Object
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# File 'lib/wsdl/operationBinding.rb', line 87
def operation_info
qname = soapoperation_name()
style = soapoperation_style()
use_input = soapbody_use(@input)
use_output = soapbody_use(@output)
info = OperationInfo.new(boundid, qname, style, use_input, use_output)
op = find_operation()
if style == :rpc
info.parts.concat(collect_rpcparameter(op))
else
info.parts.concat(collect_documentparameter(op))
end
@fault.each do |fault|
op_fault = {}
soapfault = fault.soapfault
next if soapfault.nil?
op_fault[:ns] = fault.name.namespace
op_fault[:name] = fault.name.name
op_fault[:namespace] = soapfault.namespace
op_fault[:use] = soapfault.use || "literal"
op_fault[:encodingstyle] = soapfault.encodingstyle || "document"
info.faults[fault.name] = op_fault
end
info
end
|
#parse_attr(attr, value) ⇒ Object
191
192
193
194
195
196
197
198
|
# File 'lib/wsdl/operationBinding.rb', line 191
def parse_attr(attr, value)
case attr
when NameAttrName
@name = value.source
else
nil
end
end
|
#parse_element(element) ⇒ Object
117
118
119
|
# File 'lib/wsdl/operationBinding.rb', line 117
def porttype
root.porttype(parent.type)
end
|
#soapaction ⇒ Object
157
158
159
160
161
162
163
|
# File 'lib/wsdl/operationBinding.rb', line 157
def soapaction
if @soapoperation
@soapoperation.soapaction
else
nil
end
end
|
#soapoperation_name ⇒ Object
137
138
139
140
141
142
143
|
# File 'lib/wsdl/operationBinding.rb', line 137
def soapoperation_name
op_name = find_operation.operationname
if @input and @input.soapbody and @input.soapbody.namespace
op_name = XSD::QName.new(@input.soapbody.namespace, op_name.name)
end
op_name
end
|
#soapoperation_style ⇒ Object
145
146
147
148
149
150
151
152
153
154
155
|
# File 'lib/wsdl/operationBinding.rb', line 145
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
|
#targetnamespace ⇒ Object
113
114
115
|
# File 'lib/wsdl/operationBinding.rb', line 113
def targetnamespace
parent.targetnamespace
end
|