# File lib/soap/rpc/element.rb, line 184 184: def SOAPMethod.create_doc_param_def(req_qnames, res_qnames) 185: req_qnames = [req_qnames] if req_qnames.is_a?(XSD::QName) 186: res_qnames = [res_qnames] if res_qnames.is_a?(XSD::QName) 187: param_def = [] 188: # req_qnames and res_qnames can be nil 189: if req_qnames 190: req_qnames.each do |qname| 191: param_def << [IN, qname.name, [nil, qname.namespace, qname.name]] 192: end 193: end 194: if res_qnames 195: res_qnames.each do |qname| 196: param_def << [OUT, qname.name, [nil, qname.namespace, qname.name]] 197: end 198: end 199: param_def 200: end
# File lib/soap/rpc/element.rb, line 175 175: def SOAPMethod.create_rpc_param_def(param_names) 176: param_def = [] 177: param_names.each do |param_name| 178: param_def.push([IN, param_name, nil]) 179: end 180: param_def.push([RETVAL, 'return', nil]) 181: param_def 182: end
# File lib/soap/rpc/element.rb, line 162 162: def SOAPMethod.derive_rpc_param_def(obj, name, *param) 163: if param.size == 1 and param[0].is_a?(Array) 164: return param[0] 165: end 166: if param.empty? 167: method = obj.method(name) 168: param_names = (1..method.arity.abs).collect { |i| "p#{i}" } 169: else 170: param_names = param 171: end 172: create_rpc_param_def(param_names) 173: end
# File lib/soap/rpc/element.rb, line 83 83: def initialize(qname, param_def = nil) 84: super(nil) 85: @elename = qname 86: @encodingstyle = nil 87: 88: @param_def = param_def 89: 90: @signature = [] 91: @inparam_names = [] 92: @inoutparam_names = [] 93: @outparam_names = [] 94: 95: @inparam = {} 96: @outparam = {} 97: @retval_name = nil 98: @retval_class_name = nil 99: 100: init_param(@param_def) if @param_def 101: end
# File lib/soap/rpc/element.rb, line 250 250: def self.parse_param_type(param_type) 251: mapped_class, nsdef, namedef = param_type 252: # the first element of typedef in param_def can be a String like 253: # "::SOAP::SOAPStruct" or "CustomClass[]". turn this String to a class if 254: # we can. 255: if mapped_class.is_a?(String) 256: if /\[\]\Z/ =~ mapped_class 257: # when '[]' is added, ignore this. 258: mapped_class = nil 259: else 260: mapped_class = Mapping.class_from_name(mapped_class) 261: end 262: end 263: [mapped_class, nsdef, namedef] 264: end
# File lib/soap/rpc/element.rb, line 142 142: def get_paramtypes(names) 143: types = [] 144: @signature.each do |io_type, name, type_qname| 145: if type_qname && idx = names.index(name) 146: types[idx] = type_qname 147: end 148: end 149: types 150: end
# File lib/soap/rpc/element.rb, line 103 103: def have_member 104: true 105: end
# File lib/soap/rpc/element.rb, line 107 107: def have_outparam? 108: @outparam_names.size > 0 109: end
# File lib/soap/rpc/element.rb, line 119 119: def input_param_types 120: collect_param_types(IN, INOUT) 121: end
# File lib/soap/rpc/element.rb, line 111 111: def input_params 112: collect_params(IN, INOUT) 113: end
# File lib/soap/rpc/element.rb, line 123 123: def output_param_types 124: collect_param_types(OUT, INOUT) 125: end
# File lib/soap/rpc/element.rb, line 115 115: def output_params 116: collect_params(OUT, INOUT) 117: end
# File lib/soap/rpc/element.rb, line 204 204: def collect_param_types(*type) 205: names = [] 206: @signature.each do |io_type, name, type_qname| 207: names << type_qname if type.include?(io_type) 208: end 209: names 210: end
# File lib/soap/rpc/element.rb, line 212 212: def collect_params(*type) 213: names = [] 214: @signature.each do |io_type, name, type_qname| 215: names << name if type.include?(io_type) 216: end 217: names 218: end
# File lib/soap/rpc/element.rb, line 220 220: def init_param(param_def) 221: param_def.each do |io_type, name, param_type| 222: mapped_class, nsdef, namedef = SOAPMethod.parse_param_type(param_type) 223: if nsdef && namedef 224: type_qname = XSD::QName.new(nsdef, namedef) 225: elsif mapped_class 226: type_qname = TypeMap.index(mapped_class) 227: end 228: case io_type 229: when IN 230: @signature.push([IN, name, type_qname]) 231: @inparam_names.push(name) 232: when OUT 233: @signature.push([OUT, name, type_qname]) 234: @outparam_names.push(name) 235: when INOUT 236: @signature.push([INOUT, name, type_qname]) 237: @inoutparam_names.push(name) 238: when RETVAL 239: if @retval_name 240: raise MethodDefinitionError.new('duplicated retval') 241: end 242: @retval_name = name 243: @retval_class_name = mapped_class 244: else 245: raise MethodDefinitionError.new("unknown type: #{io_type}") 246: end 247: end 248: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.