Class: SOAP::SOAPFault

Inherits:
SOAPStruct show all
Includes:
SOAPCompoundtype, SOAPEnvelopeElement
Defined in:
lib/soap/element.rb

Constant Summary

Constants included from SOAP

AttrActor, AttrActorName, AttrArrayType, AttrArrayTypeName, AttrEncodingStyle, AttrEncodingStyleName, AttrHref, AttrHrefName, AttrId, AttrIdName, 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, SOAPProxy, TypeMap, VERSION, ValueArray, ValueArrayName

Instance Attribute Summary

Attributes included from SOAPCompoundtype

#qualified

Attributes included from SOAPType

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

Attributes inherited from XSD::NSDBase

#type

Instance Method Summary collapse

Methods included from SOAPType

#inspect, #rootnode

Methods inherited from SOAPStruct

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

Methods included from Enumerable

#inject

Methods inherited from XSD::NSDBase

inherited, #init, types

Constructor Details

#initialize(faultcode = nil, faultstring = nil, faultactor = nil, detail = nil) ⇒ SOAPFault

Returns a new instance of SOAPFault



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/soap/element.rb', line 59

def initialize(faultcode = nil, faultstring = nil, faultactor = nil, detail = nil)
  super(EleFaultName)
  @elename = EleFaultName
  @encodingstyle = EncodingNamespace
  if faultcode
    self.faultcode = faultcode
    self.faultstring = faultstring
    self.faultactor = faultactor
    self.detail = detail
    self.faultcode.elename = EleFaultCodeName if self.faultcode
    self.faultstring.elename = EleFaultStringName if self.faultstring
    self.faultactor.elename = EleFaultActorName if self.faultactor
    self.detail.elename = EleFaultDetailName if self.detail
  end
  faultcode.parent = self if faultcode
  faultstring.parent = self if faultstring
  faultactor.parent = self if faultactor
  detail.parent = self if detail
end

Instance Method Details

#detailObject



39
40
41
# File 'lib/soap/element.rb', line 39

def detail
  self['detail']
end

#detail=(rhs) ⇒ Object



55
56
57
# File 'lib/soap/element.rb', line 55

def detail=(rhs)
  self['detail'] = rhs
end

#encode(generator, ns, attrs = {}) {|self.faultcode| ... } ⇒ Object

Yields:



79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/soap/element.rb', line 79

def encode(generator, ns, attrs = {})
  Generator.assign_ns(attrs, ns, EnvelopeNamespace)
  Generator.assign_ns(attrs, ns, EncodingNamespace)
  attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace
  name = ns.name(@elename)
  generator.encode_tag(name, attrs)
  yield(self.faultcode)
  yield(self.faultstring)
  yield(self.faultactor)
  yield(self.detail) if self.detail
  generator.encode_tag_end(name, true)
end

#faultactorObject



35
36
37
# File 'lib/soap/element.rb', line 35

def faultactor
  self['faultactor']
end

#faultactor=(rhs) ⇒ Object



51
52
53
# File 'lib/soap/element.rb', line 51

def faultactor=(rhs)
  self['faultactor'] = rhs
end

#faultcodeObject



27
28
29
# File 'lib/soap/element.rb', line 27

def faultcode
  self['faultcode']
end

#faultcode=(rhs) ⇒ Object



43
44
45
# File 'lib/soap/element.rb', line 43

def faultcode=(rhs)
  self['faultcode'] = rhs
end

#faultstringObject



31
32
33
# File 'lib/soap/element.rb', line 31

def faultstring
  self['faultstring']
end

#faultstring=(rhs) ⇒ Object



47
48
49
# File 'lib/soap/element.rb', line 47

def faultstring=(rhs)
  self['faultstring'] = rhs
end