Class: SOAP::RPC::SOAPMethodRequest

Inherits:
SOAPMethod show all
Defined in:
lib/soap/rpc/element.rb

Constant Summary

Constants inherited from SOAPMethod

SOAP::RPC::SOAPMethod::IN, SOAP::RPC::SOAPMethod::INOUT, SOAP::RPC::SOAPMethod::OUT, SOAP::RPC::SOAPMethod::RETVAL

Constants included from SOAP

AttrActor, AttrActorName, AttrArrayType, AttrArrayTypeName, AttrEncodingStyle, AttrEncodingStyleName, AttrHref, AttrHrefName, AttrId, AttrIdName, AttrMustUnderstand, AttrMustUnderstandName, AttrOffset, AttrOffsetName, AttrPosition, AttrPositionName, AttrRoot, AttrRootName, Base64Literal, Charset, EleBody, EleBodyName, EleEnvelope, EleEnvelopeName, EleFault, EleFaultActor, EleFaultActorName, EleFaultCode, EleFaultCodeName, EleFaultDetail, EleFaultDetailName, EleFaultName, EleFaultString, EleFaultStringName, EleHeader, EleHeaderName, EncodingNamespace, EnvelopeNamespace, LiteralNamespace, MediaType, NextActor, PropertyName, SOAP::RPCRouter, SOAP::RPCServerException, SOAP::RPCUtils, SOAPGenerator, SOAPProxy, TypeMap, VERSION, ValueArray, ValueArrayName

Instance Attribute Summary collapse

Attributes inherited from SOAPMethod

#inparam, #outparam, #param_def, #retval_class_name, #retval_name

Attributes included from SOAPCompoundtype

#qualified

Attributes included from SOAPType

#definedtype, #elename, #encodingstyle, #extraattr, #id, #parent, #position, #precedents, #root

Attributes inherited from XSD::NSDBase

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SOAPMethod

create_doc_param_def, create_rpc_param_def, derive_rpc_param_def, #get_paramtypes, #have_member, #have_outparam?, #input_param_types, #input_params, #output_param_types, #output_params, param_count, #set_outparam, #set_param

Methods inherited from SOAPStruct

#[], #[]=, #add, decode, #have_member, #key?, #members, #replace, #to_obj, #to_s

Methods included from SOAPType

#inspect, #rootnode

Methods included from Enumerable

#inject

Methods inherited from XSD::NSDBase

inherited, #init, types

Constructor Details

#initialize(qname, param_def = nil, soapaction = nil) ⇒ SOAPMethodRequest

Returns a new instance of SOAPMethodRequest.


287
288
289
290
# File 'lib/soap/rpc/element.rb', line 287

def initialize(qname, param_def = nil, soapaction = nil)
  super(qname, param_def)
  @soapaction = soapaction
end

Instance Attribute Details

#soapactionObject

Returns the value of attribute soapaction


269
270
271
# File 'lib/soap/rpc/element.rb', line 269

def soapaction
  @soapaction
end

Class Method Details

.create_request(qname, *params) ⇒ Object


271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/soap/rpc/element.rb', line 271

def SOAPMethodRequest.create_request(qname, *params)
  param_def = []
  param_value = []
  i = 0
  params.each do |param|
    param_name = "p#{i}"
    i += 1
    param_def << [IN, param_name, nil]
    param_value << [param_name, param]
  end
  param_def << [RETVAL, 'return', nil]
  o = new(qname, param_def)
  o.set_param(param_value)
  o
end

Instance Method Details

#create_method_response(response_name = nil) ⇒ Object


307
308
309
310
311
# File 'lib/soap/rpc/element.rb', line 307

def create_method_response(response_name = nil)
  response_name ||=
    XSD::QName.new(@elename.namespace, @elename.name + 'Response')
  SOAPMethodResponse.new(response_name, @param_def)
end

#dupObject


301
302
303
304
305
# File 'lib/soap/rpc/element.rb', line 301

def dup
  req = self.class.new(@elename.dup, @param_def, @soapaction)
  req.encodingstyle = @encodingstyle
  req
end

#eachObject


292
293
294
295
296
297
298
299
# File 'lib/soap/rpc/element.rb', line 292

def each
  input_params.each do |name|
    unless @inparam[name]
      raise ParameterError.new("parameter: #{name} was not given")
    end
    yield(name, @inparam[name])
  end
end