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_outparam?, #input_params, #output_params, param_count, #set_outparam, #set_param

Methods inherited from SOAPStruct

#[], #[]=, #add, decode, #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.



252
253
254
255
# File 'lib/soap/rpc/element.rb', line 252

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.



234
235
236
# File 'lib/soap/rpc/element.rb', line 234

def soapaction
  @soapaction
end

Class Method Details

.create_request(qname, *params) ⇒ Object



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/soap/rpc/element.rb', line 236

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



272
273
274
275
276
# File 'lib/soap/rpc/element.rb', line 272

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



266
267
268
269
270
# File 'lib/soap/rpc/element.rb', line 266

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

#eachObject



257
258
259
260
261
262
263
264
# File 'lib/soap/rpc/element.rb', line 257

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