| Class | WSDL::SOAP::Operation |
| In: |
lib/wsdl/soap/operation.rb
|
| Parent: | Info |
| soapaction | [R] | |
| style | [R] |
# File lib/wsdl/soap/operation.rb, line 40
40: def initialize
41: super
42: @soapaction = nil
43: @style = nil
44: end
# File lib/wsdl/soap/operation.rb, line 66
66: def input_info
67: name_info = parent.find_operation.input_info
68: param_info(name_info, parent.input)
69: end
# File lib/wsdl/soap/operation.rb, line 76
76: def operation_style
77: return @style if @style
78: if parent_binding.soapbinding
79: return parent_binding.soapbinding.style
80: end
81: nil
82: end
# File lib/wsdl/soap/operation.rb, line 71
71: def output_info
72: name_info = parent.find_operation.output_info
73: param_info(name_info, parent.output)
74: end
# File lib/wsdl/soap/operation.rb, line 50
50: def parse_attr(attr, value)
51: case attr
52: when StyleAttrName
53: if ["document", "rpc"].include?(value.source)
54: @style = value.source.intern
55: else
56: raise Parser::AttributeConstraintError.new(
57: "Unexpected value #{ value }.")
58: end
59: when SOAPActionAttrName
60: @soapaction = value.source
61: else
62: nil
63: end
64: end
# File lib/wsdl/soap/operation.rb, line 90
90: def param_info(name_info, param)
91: op_name = name_info.op_name
92: optype_name = name_info.optype_name
93:
94: soapheader = param.soapheader
95: headerparts = soapheader.collect { |item| item.find_part }
96:
97: soapbody = param.soapbody
98: if soapbody.encodingstyle and
99: soapbody.encodingstyle != ::SOAP::EncodingNamespace
100: raise NotImplementedError.new(
101: "EncodingStyle '#{ soapbody.encodingstyle }' not supported.")
102: end
103: if soapbody.namespace
104: op_name = XSD::QName.new(soapbody.namespace, op_name.name)
105: end
106: if soapbody.parts
107: target = soapbody.parts.split(/\s+/)
108: bodyparts = name_info.parts.find_all { |part|
109: target.include?(part.name)
110: }
111: else
112: bodyparts = name_info.parts
113: end
114:
115: faultpart = nil
116: OperationInfo.new(operation_style, op_name, optype_name, headerparts, bodyparts, faultpart, parent.soapaction)
117: end