2
require 'soap/rpc/standaloneServer'
3
require 'soap/rpc/driver'
5
if defined?(HTTPAccess2)
10
class TestNoIndent < Test::Unit::TestCase
13
class NopServer < SOAP::RPC::StandaloneServer
16
add_rpc_method(self, 'nop')
20
SOAP::RPC::SOAPVoid.new
25
@server = NopServer.new(self.class.name, nil, '0.0.0.0', Port)
26
@server.level = Logger::Severity::ERROR
30
@endpoint = "http://localhost:#{Port}/"
31
@client = SOAP::RPC::Driver.new(@endpoint)
32
@client.add_rpc_method('nop')
43
%q[<?xml version="1.0" encoding="utf-8" ?>
44
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
45
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
46
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
48
<nop env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
54
%q[<?xml version="1.0" encoding="utf-8" ?>
55
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
56
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
57
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
59
<nop env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
65
@client.wiredump_dev = str = ''
66
@client.options["soap.envelope.no_indent"] = false
68
assert_equal(INDENT_XML, parse_requestxml(str))
72
@client.wiredump_dev = str = ''
73
@client.options["soap.envelope.no_indent"] = true
75
assert_equal(NO_INDENT_XML, parse_requestxml(str))
78
def parse_requestxml(str)
79
str.split(/\r?\n\r?\n/)[3]