Sha256: edeff02ac25fa5c0c4f12a06211cd102d10a505594982045cf9b2191729dc680

Contents?: true

Size: 1.47 KB

Versions: 15

Compression:

Stored size: 1.47 KB

Contents

# encoding: ASCII-8BIT
require 'helper'
require 'soap/processor'
require 'soap/mapping'
require 'soap/rpc/element'
require 'wsdl/parser'


module WSDL


class TestFault < Test::Unit::TestCase
  def setup
    @xml =<<__EOX__
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <env:Fault xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/"
        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <faultcode>Server</faultcode>
      <faultstring>faultstring</faultstring>
      <faultactor>faultactor</faultactor>
      <detail xmlns:n2="http://www.ruby-lang.org/xmlns/ruby/type/custom"
          xsi:type="n2:SOAPException">
	<excn_type_name xsi:type="xsd:string">type</excn_type_name>
	<cause href="#id123"/>
      </detail>
    </env:Fault>
    <cause id="id123" xsi:type="xsd:int">5</cause>
  </env:Body>
</env:Envelope>
__EOX__
  end

  def test_by_wsdl
    rpc_decode_typemap = WSDL::Definitions.soap_rpc_complextypes
    opt = {}
    opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
    header, body = ::SOAP::Processor.unmarshal(@xml, opt)
    fault = ::SOAP::Mapping.soap2obj(body.response)
    assert_equal("Server", fault.faultcode)
    assert_equal("faultstring", fault.faultstring)
    assert_equal("faultactor", fault.faultactor)
    assert_equal(5, fault.detail.cause)
  end
end


end

Version data entries

15 entries across 15 versions & 9 rubygems

Version Path
malagant-soap4r-1.5.8.20141127181857 test/wsdl/test_fault.rb
rtiss_soap4r-1.6.1 test/wsdl/test_fault.rb
rtiss_soap4r-1.6.0 test/wsdl/test_fault.rb
eSpace_soap4r-1.5.8 test/wsdl/test_fault.rb
soap4r-ruby19-1.5.9 test/wsdl/test_fault.rb
tomdz-soap4r-1.5.8.20120202093209 test/wsdl/test_fault.rb
soap5r-2.0.3 test/wsdl/test_fault.rb
soap5r-2.0.2 test/wsdl/test_fault.rb
soap5r-2.0.1 test/wsdl/test_fault.rb
soap5r-2.0.0 test/wsdl/test_fault.rb
soap5r-2.0.0.20120130130121 test/wsdl/test_fault.rb
soap4r-sgonyea-1.5.9 test/wsdl/test_fault.rb
sunteya-soap4r-1.5.8.0 test/wsdl/test_fault.rb
tomdz-soap4r-1.5.8.20111103171510 test/wsdl/test_fault.rb
rubyjedi-soap4r-1.5.8.20100619003610 test/wsdl/test_fault.rb