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, SOAPNamespaceTag, SOAPProxy, TypeMap, ValueArray, ValueArrayName, Version, XSDNamespaceTag, XSINamespaceTag

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 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.



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

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



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

def detail
  self['detail']
end

#detail=(rhs) ⇒ Object



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

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

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

Yields:



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

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



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

def faultactor
  self['faultactor']
end

#faultactor=(rhs) ⇒ Object



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

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

#faultcodeObject



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

def faultcode
  self['faultcode']
end

#faultcode=(rhs) ⇒ Object



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

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

#faultstringObject



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

def faultstring
  self['faultstring']
end

#faultstring=(rhs) ⇒ Object



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

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