1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
require 'soap/mapping'
module SOAPBuildersInteropResult
extend SOAP
InterfaceNS = 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInteropResult/0.0.1'
TypeNS = 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInteropResult/type/0.0.1'
class Endpoint
include SOAP::Marshallable
attr_accessor :processorName, :processorVersion, :endpointName, :uri, :wsdl
def initialize( endpointName = nil, uri = nil, wsdl = nil )
@processorName = 'unknown'
@processorVersion = nil
@endpointName = endpointName
@uri = uri
@wsdl = wsdl
end
def name
if @endpointName
@endpointName
elsif @processorVersion
"#{ @processorName }-#{ @processorVersion }"
else
"#{ @processorName }"
end
end
end
class TestResult
include SOAP::Marshallable
attr_accessor :testName, :result, :comment, :wiredump
def initialize( testName, result, comment = nil, wiredump = nil )
@testName = testName
@result = result
@comment = comment
@wiredump = wiredump
end
end
class InteropResults
include SOAP::Marshallable
include Enumerable
attr_accessor :dateTime, :server, :client
def initialize( client = nil, server = nil )
@dateTime = Time.now
@server = server
@client = client
@testResults = []
end
def add( testResult )
@testResults << testResult
end
def clear
@testResults.clear
end
def each
@testResults.each do | item |
yield( item )
end
end
def size
@testResults.size
end
end
Methods = [
[ 'addResults', [:in, 'interopResults' ]],
[ 'deleteResults', [:in, 'client'], [:in, 'server']],
]
MappingRegistry = SOAP::Mapping::Registry.new
MappingRegistry.set(
::SOAPBuildersInteropResult::Endpoint,
::SOAP::SOAPStruct,
::SOAP::Mapping::Registry::TypedStructFactory,
[ XSD::QName.new(TypeNS, 'Endpoint') ]
)
MappingRegistry.set(
::SOAPBuildersInteropResult::TestResult,
::SOAP::SOAPStruct,
::SOAP::Mapping::Registry::TypedStructFactory,
[ XSD::QName.new(TypeNS, 'TestResult') ]
)
MappingRegistry.set(
::SOAPBuildersInteropResult::InteropResults,
::SOAP::SOAPStruct,
::SOAP::Mapping::Registry::TypedStructFactory,
[ XSD::QName.new(TypeNS, 'InteropResults') ]
)
end
|