def serialize_soap_fault(ex)
      logger.debug "Serializing SOAP Fault: #{ex.inspect}"

      xb = Builder::XmlMarkup.new
      xb.instruct!

      xb.tag! 'e:Envelope', 'xmlns:e' => soap_env_ns do |xenv|
        xenv.tag! 'e:Body' do |xbody|
          xbody.tag! 'e:Fault' do |xf|
            case soap_version
              when :soap11
                xf.faultcode "e:Server.#{ex.class.name}"
                xf.faultstring ex.message
              when :soap12
                xf.tag! 'e:Code' do |xcode|
                  xcode.tag! 'e:Value', 'e:Receiver'
                  xcode.tag! 'e:Subcode' do |xsubcode|
                    xsubcode.tag! 'e:Value', ex.class.name
                  end
                end
                xf.tag! 'e:Reason', ex.message
              else
                raise "Unsupported SOAP version: #{soap_version}"
            end
          end
        end
      end
    end
def serialize_soap_fault(ex)
      logger.debug "Serializing SOAP Fault: #{ex.inspect}"

      xb = Builder::XmlMarkup.new
      xb.instruct!

      xb.tag! 'e:Envelope', 'xmlns:e' => soap_env_ns do |xenv|
        xenv.tag! 'e:Body' do |xbody|
          xbody.tag! 'e:Fault' do |xf|
            case soap_version
              when :soap11
                xf.faultcode "e:Server.#{ex.class.name}"
                xf.faultstring ex.message
              when :soap12
                xf.tag! 'e:Code' do |xcode|
                  xcode.tag! 'e:Value', 'e:Receiver'
                  xcode.tag! 'e:Subcode' do |xsubcode|
                    xsubcode.tag! 'e:Value', ex.class.name
                  end
                end
                xf.tag! 'e:Reason', ex.message
              else
                raise "Unsupported SOAP version: #{soap_version}"
            end
          end
        end
      end
    end
Serializes an exception as a SOAP Envelope containing a SOAP Fault.

 @param ex [Exception] The Exception to serialize.
 @return [String] The SOAP Envelope containing the Fault.
noinspection RubyArgCount