rubyjedi-soap4r 1.5.8.01 → 1.5.8.20100616125722
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/wsdl2ruby.rb +1 -0
- data/bin/xsd2ruby.rb +1 -1
- data/lib/soap/baseData.rb +1 -1
- data/lib/soap/element.rb +0 -2
- data/lib/soap/generator.rb +1 -2
- data/lib/soap/mapping/encodedregistry.rb +1 -0
- data/lib/soap/mapping/factory.rb +2 -2
- data/lib/soap/mapping/mapping.rb +3 -4
- data/lib/soap/mapping/registry.rb +0 -15
- data/lib/soap/mapping/rubytypeFactory.rb +0 -1
- data/lib/soap/mapping/wsdlencodedregistry.rb +1 -1
- data/lib/soap/mimemessage.rb +1 -0
- data/lib/soap/nestedexception.rb +1 -1
- data/lib/soap/netHttpClient.rb +4 -4
- data/lib/soap/ns.rb +4 -0
- data/lib/soap/property.rb +21 -15
- data/lib/soap/rpc/element.rb +1 -1
- data/lib/soap/rpc/standaloneServer.rb +1 -1
- data/lib/soap/soap.rb +4 -2
- data/lib/soap/streamHandler.rb +1 -1
- data/lib/soap/version.rb +8 -0
- data/lib/soap/wsdlDriver.rb +2 -2
- data/lib/wsdl/parser.rb +4 -4
- data/lib/wsdl/soap/classDefCreatorSupport.rb +1 -1
- data/lib/wsdl/soap/clientSkeltonCreator.rb +4 -2
- data/lib/wsdl/soap/driverCreator.rb +4 -2
- data/lib/wsdl/soap/methodDefCreator.rb +1 -1
- data/lib/wsdl/soap/servantSkeltonCreator.rb +4 -2
- data/lib/wsdl/soap/wsdl2ruby.rb +1 -1
- data/lib/wsdl/xmlSchema/parser.rb +4 -4
- data/lib/wsdl/xmlSchema/xsd2ruby.rb +1 -1
- data/lib/xsd/charset.rb +4 -3
- data/lib/xsd/codegen/gensupport.rb +8 -5
- data/lib/xsd/datatypes.rb +6 -6
- data/lib/xsd/ns.rb +1 -1
- data/lib/xsd/qname.rb +2 -2
- data/lib/xsd/xmlparser.rb +11 -17
- data/lib/xsd/xmlparser/libxmlparser.rb +6 -10
- data/test/helper.rb +6 -0
- data/test/soap/asp.net/test_aspdotnet.rb +3 -3
- data/test/soap/auth/test_basic.rb +2 -2
- data/test/soap/auth/test_digest.rb +2 -2
- data/test/soap/calc/server.cgi +2 -0
- data/test/soap/calc/test_calc.rb +3 -2
- data/test/soap/calc/test_calc2.rb +3 -2
- data/test/soap/calc/test_calc_cgi.rb +1 -1
- data/test/soap/case/test_mapping.rb +2 -2
- data/test/soap/fault/test_customfault.rb +1 -1
- data/test/soap/fault/test_fault.rb +1 -1
- data/test/soap/fault/test_soaparray.rb +1 -1
- data/test/soap/filter/test_filter.rb +1 -1
- data/test/soap/header/server.cgi +1 -0
- data/test/soap/header/test_authheader.rb +1 -1
- data/test/soap/header/test_authheader_cgi.rb +1 -1
- data/test/soap/header/test_simplehandler.rb +1 -1
- data/test/soap/helloworld/test_helloworld.rb +3 -2
- data/test/soap/literalArrayMapping/test_definedarray.rb +2 -2
- data/test/soap/marshal/marshaltestlib.rb +5 -2
- data/test/soap/marshal/test_digraph.rb +1 -1
- data/test/soap/marshal/test_marshal.rb +3 -2
- data/test/soap/marshal/test_struct.rb +1 -1
- data/test/soap/ssl/sslsvr.rb +1 -0
- data/test/soap/ssl/test_ssl.rb +1 -1
- data/test/soap/struct/test_struct.rb +2 -2
- data/test/soap/swa/test_file.rb +1 -1
- data/test/soap/test_basetype.rb +1 -1
- data/test/soap/test_cookie.rb +2 -2
- data/test/soap/test_custom_ns.rb +4 -4
- data/test/soap/test_custommap.rb +1 -1
- data/test/soap/test_empty.rb +6 -6
- data/test/soap/test_envelopenamespace.rb +2 -2
- data/test/soap/test_extraattr.rb +2 -2
- data/test/soap/test_generator.rb +5 -3
- data/test/soap/test_httpconfigloader.rb +1 -1
- data/test/soap/test_mapping.rb +1 -1
- data/test/soap/test_nestedexception.rb +28 -14
- data/test/soap/test_nil.rb +23 -28
- data/test/soap/test_no_indent.rb +3 -3
- data/test/soap/test_property.rb +2 -2
- data/test/soap/test_response_as_xml.rb +4 -4
- data/test/soap/test_soapelement.rb +1 -1
- data/test/soap/test_streamhandler.rb +2 -2
- data/test/soap/test_styleuse.rb +2 -2
- data/test/soap/wsdlDriver/test_calc.rb +2 -2
- data/test/soap/wsdlDriver/test_document.rb +2 -2
- data/test/soap/wsdlDriver/test_simpletype.rb +3 -2
- data/test/testutil.rb +4 -4
- data/test/wsdl/abstract/test_abstract.rb +2 -2
- data/test/wsdl/anonymous/test_anonymous.rb +2 -2
- data/test/wsdl/any/test_any.rb +2 -2
- data/test/wsdl/axisArray/test_axisarray.rb +2 -2
- data/test/wsdl/choice/test_choice.rb +2 -2
- data/test/wsdl/complexcontent/test_echo.rb +2 -2
- data/test/wsdl/datetime/test_datetime.rb +3 -2
- data/test/wsdl/document/array/test_array.rb +2 -2
- data/test/wsdl/document/test_nosoapaction.rb +2 -2
- data/test/wsdl/document/test_number.rb +2 -2
- data/test/wsdl/document/test_rpc.rb +2 -2
- data/test/wsdl/fault/multifault.wsdl +8 -8
- data/test/wsdl/fault/test_fault.rb +3 -3
- data/test/wsdl/fault/test_multifault.rb +13 -13
- data/test/wsdl/group/test_rpc.rb +2 -2
- data/test/wsdl/list/test_list.rb +2 -2
- data/test/wsdl/map/test_map.rb +1 -1
- data/test/wsdl/marshal/test_wsdlmarshal.rb +3 -4
- data/test/wsdl/oneway/test_oneway.rb +2 -2
- data/test/wsdl/overload/test_overload.rb +2 -2
- data/test/wsdl/qualified/test_qualified.rb +4 -4
- data/test/wsdl/qualified/test_unqualified.rb +4 -4
- data/test/wsdl/raa/test_raa.rb +4 -4
- data/test/wsdl/ref/test_ref.rb +2 -2
- data/test/wsdl/rpc/test_rpc.rb +2 -2
- data/test/wsdl/rpc/test_rpc_lit.rb +18 -18
- data/test/wsdl/simplecontent/test_simplecontent.rb +2 -2
- data/test/wsdl/simpletype/rpc/test_rpc.rb +2 -2
- data/test/wsdl/simpletype/test_simpletype.rb +2 -2
- data/test/wsdl/soap/test_soapbodyparts.rb +1 -1
- data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +2 -2
- data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +2 -2
- data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +2 -2
- data/test/wsdl/soaptype/test_soaptype.rb +5 -5
- data/test/wsdl/test_emptycomplextype.rb +1 -1
- data/test/wsdl/test_fault.rb +1 -1
- data/test/wsdl/test_multiplefault.rb +1 -1
- data/test/xsd/codegen/test_classdef.rb +1 -1
- data/test/xsd/test_noencoding.rb +1 -1
- data/test/xsd/test_ns.rb +1 -1
- data/test/xsd/test_xmlschemaparser.rb +1 -1
- data/test/xsd/test_xsd.rb +1 -1
- data/test/xsd/xsd2ruby/test_xsd2ruby.rb +3 -3
- metadata +24 -33
- data/lib/soap/rpc/element.rb.orig +0 -378
- data/lib/soap/ruby18ext.rb +0 -13
- data/lib/xsd/xmlparser.rb.orig +0 -110
- data/test/results +0 -4810
- data/test/soap/header/session.pstoredb +0 -0
- data/test/wsdl/marshal/Person.rb +0 -1
- data/test/wsdl/simpletype/rpc/echo_version.rb +0 -1
- data/test/wsdl/simpletype/rpc/echo_versionDriver.rb +0 -10
- data/test/wsdl/simpletype/rpc/echo_versionMappingRegistry.rb +0 -4
- data/test/wsdl/simpletype/rpc/echo_versionServant.rb +0 -3
- data/test/wsdl/simpletype/rpc/echo_version_service.rb +0 -3
- data/test/wsdl/simpletype/rpc/echo_version_serviceClient.rb +0 -34
- data/test/wsdl/soap/wsdl2ruby/echo_version.rb +0 -1
- data/test/wsdl/soap/wsdl2ruby/echo_versionDriver.rb +0 -10
- data/test/wsdl/soap/wsdl2ruby/echo_versionMappingRegistry.rb +0 -4
- data/test/wsdl/soap/wsdl2ruby/echo_versionServant.rb +0 -3
- data/test/wsdl/soap/wsdl2ruby/echo_version_service.cgi +0 -3
- data/test/wsdl/soap/wsdl2ruby/echo_version_service.rb +0 -7
- data/test/wsdl/soap/wsdl2ruby/echo_version_serviceClient.rb +0 -34
@@ -49,7 +49,7 @@ private
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def create_file
|
52
|
-
@modulepath =
|
52
|
+
@modulepath = @opt['module_path']
|
53
53
|
create_classdef if @opt.key?('classdef')
|
54
54
|
create_mapping_registry if @opt.key?('mapping_registry')
|
55
55
|
create_mapper if @opt.key?('mapper')
|
data/lib/xsd/charset.rb
CHANGED
@@ -10,7 +10,7 @@ module XSD
|
|
10
10
|
|
11
11
|
|
12
12
|
module Charset
|
13
|
-
@internal_encoding =
|
13
|
+
@internal_encoding = (RUBY_VERSION.to_f >= 1.9) ? 'UTF8' : $KCODE
|
14
14
|
|
15
15
|
class XSDError < StandardError; end
|
16
16
|
class CharsetError < XSDError; end
|
@@ -129,7 +129,7 @@ public
|
|
129
129
|
|
130
130
|
# us_ascii = '[\x00-\x7F]'
|
131
131
|
us_ascii = '[\x9\xa\xd\x20-\x7F]' # XML 1.0 restricted.
|
132
|
-
USASCIIRegexp = Regexp.new("\\A#{us_ascii}*\\z")
|
132
|
+
USASCIIRegexp = Regexp.new("\\A#{us_ascii}*\\z", nil, 'n')
|
133
133
|
|
134
134
|
twobytes_euc = '(?:[\x8E\xA1-\xFE][\xA1-\xFE])'
|
135
135
|
threebytes_euc = '(?:\x8F[\xA1-\xFE][\xA1-\xFE])'
|
@@ -149,7 +149,8 @@ public
|
|
149
149
|
threebytes_utf8 = '(?:[\xE0-\xEF][\x80-\xBF][\x80-\xBF])'
|
150
150
|
# 11110uuu 10uuuzzz 10yyyyyy 10xxxxxx
|
151
151
|
fourbytes_utf8 = '(?:[\xF0-\xF7][\x80-\xBF][\x80-\xBF][\x80-\xBF])'
|
152
|
-
character_utf8 =
|
152
|
+
character_utf8 =
|
153
|
+
"(?:#{us_ascii}|#{twobytes_utf8}|#{threebytes_utf8}|#{fourbytes_utf8})"
|
153
154
|
UTF8Regexp = Regexp.new("\\A#{character_utf8}*\\z", nil, 'n')
|
154
155
|
|
155
156
|
def Charset.is_us_ascii(str)
|
@@ -227,7 +227,7 @@ module GenSupport
|
|
227
227
|
str = trim_eol(str)
|
228
228
|
str = trim_indent(str)
|
229
229
|
if indent
|
230
|
-
str.gsub(/^/, " " * indent)
|
230
|
+
str.to_s.gsub(/^/, " " * indent)
|
231
231
|
else
|
232
232
|
str
|
233
233
|
end
|
@@ -236,22 +236,25 @@ module GenSupport
|
|
236
236
|
private
|
237
237
|
|
238
238
|
def trim_eol(str)
|
239
|
-
str.lines.
|
239
|
+
str = str.lines if str.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
|
240
|
+
str.collect { |line|
|
240
241
|
line.sub(/\r?\n\z/, "") + "\n"
|
241
242
|
}.join
|
242
243
|
end
|
243
244
|
|
244
245
|
def trim_indent(str)
|
245
246
|
indent = nil
|
246
|
-
str = str.lines
|
247
|
-
str.
|
247
|
+
str = str.lines if str.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
|
248
|
+
str = str.collect { |line| untab(line) }.join
|
249
|
+
str = str.lines if str.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
|
250
|
+
str.each do |line|
|
248
251
|
head = line.index(/\S/)
|
249
252
|
if !head.nil? and (indent.nil? or head < indent)
|
250
253
|
indent = head
|
251
254
|
end
|
252
255
|
end
|
253
256
|
return str unless indent
|
254
|
-
str.
|
257
|
+
str.collect { |line|
|
255
258
|
line.sub(/^ {0,#{indent}}/, "")
|
256
259
|
}.join
|
257
260
|
end
|
data/lib/xsd/datatypes.rb
CHANGED
@@ -631,7 +631,7 @@ private
|
|
631
631
|
if secfrac
|
632
632
|
diffday = secfrac.to_i.to_r / (10 ** secfrac.size) / DayInSec
|
633
633
|
data += diffday
|
634
|
-
# FYI:
|
634
|
+
# FYI: new! and jd_to_rjd are not necessary to use if you don't have
|
635
635
|
# exceptional reason.
|
636
636
|
end
|
637
637
|
[data, secfrac]
|
@@ -647,14 +647,14 @@ private
|
|
647
647
|
|
648
648
|
def _to_s
|
649
649
|
year = (@data.year > 0) ? @data.year : @data.year - 1
|
650
|
-
s = format('%.4d-%02d-%02dT%02d:%02d:%02d',
|
651
|
-
year, @data.mon, @data.mday, @data.hour, @data.min, @data.sec)
|
650
|
+
s = format('%.4d-%02d-%02dT%02d:%02d:%02d', year, @data.mon, @data.mday, @data.hour, @data.min, @data.sec)
|
652
651
|
if @data.sec_fraction.nonzero?
|
653
652
|
if @secfrac
|
654
|
-
|
653
|
+
s << ".#{ @secfrac }"
|
654
|
+
elsif (RUBY_VERSION.to_f >= 1.9) # RubyJedi: Ruby 1.9's DateTime.sec_fraction() appears to be more 'sane' and doesn't need to be multiplied.
|
655
|
+
s << sprintf("%.16f", @data.sec_fraction.to_f).sub(/^0/, '').sub(/0*$/, '')
|
655
656
|
else
|
656
|
-
|
657
|
-
(@data.sec_fraction * DayInSec).to_f).sub(/^0/, '').sub(/0*$/, '')
|
657
|
+
s << sprintf("%.16f",(@data.sec_fraction * DayInSec).to_f).sub(/^0/, '').sub(/0*$/, '')
|
658
658
|
end
|
659
659
|
end
|
660
660
|
add_tz(s)
|
data/lib/xsd/ns.rb
CHANGED
data/lib/xsd/qname.rb
CHANGED
data/lib/xsd/xmlparser.rb
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
require 'xsd/xmlparser/parser'
|
10
|
-
require 'soap/property'
|
11
10
|
|
12
11
|
|
13
12
|
module XSD
|
@@ -20,7 +19,7 @@ module XMLParser
|
|
20
19
|
module_function :create_parser
|
21
20
|
|
22
21
|
# $1 is necessary.
|
23
|
-
NSParseRegexp = Regexp.new(
|
22
|
+
NSParseRegexp = Regexp.new('^xmlns:?(.*)$', nil, 'n')
|
24
23
|
|
25
24
|
def filter_ns(ns, attrs)
|
26
25
|
ns_updated = false
|
@@ -51,26 +50,21 @@ end
|
|
51
50
|
end
|
52
51
|
|
53
52
|
|
54
|
-
PARSER_LIBS = [
|
55
|
-
'nokogiri',
|
56
|
-
'libxmlparser',
|
57
|
-
'xmlparser',
|
58
|
-
'xmlscanner',
|
59
|
-
'rexmlparser'
|
60
|
-
]
|
61
|
-
# Get library prefs
|
62
|
-
opt = ::SOAP::Property.loadproperty('soap/property')
|
63
|
-
use_libxml = (opt and opt['parser'] and opt['parser']['use_libxml'] and opt['parser']['use_libxml'] == 'false') ? false : true
|
64
53
|
# Try to load XML processor.
|
65
54
|
loaded = false
|
66
|
-
|
55
|
+
[
|
56
|
+
'nokogiri',
|
57
|
+
# 'libxmlparser',
|
58
|
+
# 'xmlparser',
|
59
|
+
# 'xmlscanner',
|
60
|
+
'rexmlparser',
|
61
|
+
].each do |name|
|
67
62
|
begin
|
68
|
-
|
69
|
-
require lib unless !use_libxml && name == 'libxmlparser'
|
63
|
+
require "xsd/xmlparser/#{name}"
|
70
64
|
# XXX: for a workaround of rubygems' require inconsistency
|
71
65
|
# XXX: MUST BE REMOVED IN THE FUTURE
|
72
66
|
raise LoadError unless XSD::XMLParser.constants.find { |c|
|
73
|
-
c.to_s.downcase == name
|
67
|
+
c.to_s.downcase == name
|
74
68
|
}
|
75
69
|
loaded = true
|
76
70
|
break
|
@@ -79,4 +73,4 @@ PARSER_LIBS.each do |name|
|
|
79
73
|
end
|
80
74
|
unless loaded
|
81
75
|
raise RuntimeError.new("XML processor module not found.")
|
82
|
-
end
|
76
|
+
end
|
@@ -25,11 +25,12 @@ class LibXMLParser < XSD::XMLParser::Parser
|
|
25
25
|
end
|
26
26
|
# XMLParser passes a String in utf-8.
|
27
27
|
@charset = 'utf-8'
|
28
|
-
@parser = XML::SaxParser.
|
28
|
+
@parser = XML::SaxParser.new
|
29
29
|
@parser.callbacks = self
|
30
|
+
@parser.string = string
|
30
31
|
@parser.parse
|
31
32
|
end
|
32
|
-
|
33
|
+
|
33
34
|
ENTITY_REF_MAP = {
|
34
35
|
'lt' => '<',
|
35
36
|
'gt' => '>',
|
@@ -61,14 +62,9 @@ class LibXMLParser < XSD::XMLParser::Parser
|
|
61
62
|
#def on_end_document()
|
62
63
|
# nil
|
63
64
|
#end
|
64
|
-
|
65
|
-
def
|
66
|
-
name
|
67
|
-
namespaces.each do |key,value|
|
68
|
-
nsprefix = key.nil? ? "xmlns" : "xmlns:#{key}"
|
69
|
-
attributes[nsprefix] = value
|
70
|
-
end
|
71
|
-
start_element(name, attributes)
|
65
|
+
|
66
|
+
def on_start_element(name, attr_hash)
|
67
|
+
start_element(name, attr_hash)
|
72
68
|
end
|
73
69
|
|
74
70
|
def on_end_element(name)
|
data/test/helper.rb
ADDED
@@ -1,7 +1,7 @@
|
|
1
|
-
require '
|
1
|
+
require 'helper'
|
2
|
+
require 'testutil'
|
2
3
|
require 'soap/rpc/standaloneServer'
|
3
4
|
require 'soap/rpc/driver'
|
4
|
-
require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')
|
5
5
|
|
6
6
|
|
7
7
|
module SOAP; module ASPDotNet
|
@@ -108,7 +108,7 @@ __XML__
|
|
108
108
|
@client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name')
|
109
109
|
@client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace
|
110
110
|
assert_equal("Hello Mike", @client.sayHello("Mike"))
|
111
|
-
|
111
|
+
assert_xml_equal(REQUEST_ASPDOTNETHANDLER, parse_requestxml(str),
|
112
112
|
[REQUEST_ASPDOTNETHANDLER, parse_requestxml(str)].join("\n\n"))
|
113
113
|
end
|
114
114
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'helper'
|
2
|
+
require 'testutil'
|
2
3
|
require 'soap/rpc/driver'
|
3
4
|
require 'webrick'
|
4
5
|
require 'webrick/httpproxy'
|
5
6
|
require 'logger'
|
6
|
-
require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')
|
7
7
|
|
8
8
|
|
9
9
|
module SOAP; module Auth
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'helper'
|
2
|
+
require 'testutil'
|
2
3
|
require 'soap/rpc/driver'
|
3
4
|
require 'webrick'
|
4
5
|
require 'webrick/httpproxy'
|
5
6
|
require 'logger'
|
6
|
-
require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')
|
7
7
|
|
8
8
|
|
9
9
|
module SOAP; module Auth
|
data/test/soap/calc/server.cgi
CHANGED
data/test/soap/calc/test_calc.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'helper'
|
2
2
|
require 'soap/marshal'
|
3
3
|
|
4
4
|
|
@@ -49,7 +49,7 @@ class TestMapping < Test::Unit::TestCase
|
|
49
49
|
</env:Envelope>
|
50
50
|
__XML__
|
51
51
|
o = TTMHeader.new("dsn", "password", "schema", "username")
|
52
|
-
|
52
|
+
assert_xml_equal(dump, SOAP::Marshal.dump(o))
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
data/test/soap/header/server.cgi
CHANGED
@@ -26,12 +26,15 @@ module MarshalTestLib
|
|
26
26
|
msg = msg ? msg + "(#{ caller[0] })" : caller[0]
|
27
27
|
o2 = marshaltest(o1)
|
28
28
|
assert_equal(o1.class, o2.class, msg)
|
29
|
+
|
29
30
|
iv1 = o1.instance_variables.sort
|
30
31
|
iv2 = o2.instance_variables.sort
|
31
32
|
assert_equal(iv1, iv2)
|
32
|
-
|
33
|
-
|
33
|
+
|
34
|
+
val1 = iv1.map {|var| o1.instance_eval( "#{var}" )}
|
35
|
+
val2 = iv1.map {|var| o2.instance_eval( "#{var}" )}
|
34
36
|
assert_equal(val1, val2, msg)
|
37
|
+
|
35
38
|
if block_given?
|
36
39
|
assert_equal(yield(o1), yield(o2), msg)
|
37
40
|
else
|