| 225 | | unless parent.node.is_a?(SOAPBody) |
|---|
| 226 | | raise FormatDecodeError.new("Fault should be a child of Body.") |
|---|
| 227 | | end |
|---|
| 228 | | o = SOAPFault.new |
|---|
| 229 | | parent.node.fault = o |
|---|
| | 225 | if parent.node.is_a?(SOAPBody) |
|---|
| | 226 | o = SOAPFault.new |
|---|
| | 227 | parent.node.fault = o |
|---|
| | 228 | elsif parent.node.is_a?(SOAPEnvelope) |
|---|
| | 229 | # live.com server returns SOAPFault as a direct child of SOAPEnvelope. |
|---|
| | 230 | # support it even if it's not spec compliant. |
|---|
| | 231 | warn("Fault must be a child of Body.") |
|---|
| | 232 | body = SOAPBody.new |
|---|
| | 233 | parent.node.body = body |
|---|
| | 234 | o = SOAPFault.new |
|---|
| | 235 | body.fault = o |
|---|
| | 236 | else |
|---|
| | 237 | raise FormatDecodeError.new("Fault should be a child of Body.") |
|---|
| | 238 | end |
|---|