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, 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, NS, NextActor, PropertyName, SOAP::RPCRouter, SOAP::RPCServerException, SOAP::RPCUtils, SOAPNamespaceTag, SOAPProxy, TypeMap, VERSION, ValueArray, ValueArrayName, XSDNamespaceTag, XSINamespaceTag

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 Enumerable

#inject

Methods included from SOAPType

#inspect, #rootnode

Methods inherited from XSD::NSDBase

inherited, #init, types

Constructor Details

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

Returns a new instance of SOAPMethodRequest.


275
276
277
278
# File 'lib/soap/rpc/element.rb', line 275

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


257
258
259
# File 'lib/soap/rpc/element.rb', line 257

def soapaction
  @soapaction
end

Class Method Details

.create_request(qname, *params) ⇒ Object


259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/soap/rpc/element.rb', line 259

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


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

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


289
290
291
292
293
# File 'lib/soap/rpc/element.rb', line 289

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

#eachObject


280
281
282
283
284
285
286
287
# File 'lib/soap/rpc/element.rb', line 280

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