Class: SOAP::RPC::SOAPMethodRequest

Inherits:
SOAPMethod show all
Defined in:
lib/action_web_service/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, AttrArrayType, AttrArrayTypeName, AttrEncodingStyle, AttrEncodingStyleName, AttrMustUnderstand, AttrMustUnderstandName, AttrOffset, AttrOffsetName, AttrPosition, AttrPositionName, AttrRoot, AttrRootName, Base64Literal, EleBody, EleBodyName, EleEnvelope, EleEnvelopeName, EleFault, EleFaultActor, EleFaultActorName, EleFaultCode, EleFaultCodeName, EleFaultDetail, EleFaultDetailName, EleFaultName, EleFaultString, EleFaultStringName, EleHeader, EleHeaderName, EncodingNamespace, EnvelopeNamespace, LiteralNamespace, MediaType, NextActor, PropertyName, SOAPNamespaceTag, 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 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, #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.



237
238
239
240
241
# File 'lib/action_web_service/soap/rpc/element.rb', line 237

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

Instance Attribute Details

#soapactionObject

Returns the value of attribute soapaction.



219
220
221
# File 'lib/action_web_service/soap/rpc/element.rb', line 219

def soapaction
  @soapaction
end

Class Method Details

.create_request(qname, *params) ⇒ Object



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/action_web_service/soap/rpc/element.rb', line 221

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



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

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



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

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

#eachObject



243
244
245
246
247
248
249
250
# File 'lib/action_web_service/soap/rpc/element.rb', line 243

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