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.
Files changed (150) hide show
  1. data/bin/wsdl2ruby.rb +1 -0
  2. data/bin/xsd2ruby.rb +1 -1
  3. data/lib/soap/baseData.rb +1 -1
  4. data/lib/soap/element.rb +0 -2
  5. data/lib/soap/generator.rb +1 -2
  6. data/lib/soap/mapping/encodedregistry.rb +1 -0
  7. data/lib/soap/mapping/factory.rb +2 -2
  8. data/lib/soap/mapping/mapping.rb +3 -4
  9. data/lib/soap/mapping/registry.rb +0 -15
  10. data/lib/soap/mapping/rubytypeFactory.rb +0 -1
  11. data/lib/soap/mapping/wsdlencodedregistry.rb +1 -1
  12. data/lib/soap/mimemessage.rb +1 -0
  13. data/lib/soap/nestedexception.rb +1 -1
  14. data/lib/soap/netHttpClient.rb +4 -4
  15. data/lib/soap/ns.rb +4 -0
  16. data/lib/soap/property.rb +21 -15
  17. data/lib/soap/rpc/element.rb +1 -1
  18. data/lib/soap/rpc/standaloneServer.rb +1 -1
  19. data/lib/soap/soap.rb +4 -2
  20. data/lib/soap/streamHandler.rb +1 -1
  21. data/lib/soap/version.rb +8 -0
  22. data/lib/soap/wsdlDriver.rb +2 -2
  23. data/lib/wsdl/parser.rb +4 -4
  24. data/lib/wsdl/soap/classDefCreatorSupport.rb +1 -1
  25. data/lib/wsdl/soap/clientSkeltonCreator.rb +4 -2
  26. data/lib/wsdl/soap/driverCreator.rb +4 -2
  27. data/lib/wsdl/soap/methodDefCreator.rb +1 -1
  28. data/lib/wsdl/soap/servantSkeltonCreator.rb +4 -2
  29. data/lib/wsdl/soap/wsdl2ruby.rb +1 -1
  30. data/lib/wsdl/xmlSchema/parser.rb +4 -4
  31. data/lib/wsdl/xmlSchema/xsd2ruby.rb +1 -1
  32. data/lib/xsd/charset.rb +4 -3
  33. data/lib/xsd/codegen/gensupport.rb +8 -5
  34. data/lib/xsd/datatypes.rb +6 -6
  35. data/lib/xsd/ns.rb +1 -1
  36. data/lib/xsd/qname.rb +2 -2
  37. data/lib/xsd/xmlparser.rb +11 -17
  38. data/lib/xsd/xmlparser/libxmlparser.rb +6 -10
  39. data/test/helper.rb +6 -0
  40. data/test/soap/asp.net/test_aspdotnet.rb +3 -3
  41. data/test/soap/auth/test_basic.rb +2 -2
  42. data/test/soap/auth/test_digest.rb +2 -2
  43. data/test/soap/calc/server.cgi +2 -0
  44. data/test/soap/calc/test_calc.rb +3 -2
  45. data/test/soap/calc/test_calc2.rb +3 -2
  46. data/test/soap/calc/test_calc_cgi.rb +1 -1
  47. data/test/soap/case/test_mapping.rb +2 -2
  48. data/test/soap/fault/test_customfault.rb +1 -1
  49. data/test/soap/fault/test_fault.rb +1 -1
  50. data/test/soap/fault/test_soaparray.rb +1 -1
  51. data/test/soap/filter/test_filter.rb +1 -1
  52. data/test/soap/header/server.cgi +1 -0
  53. data/test/soap/header/test_authheader.rb +1 -1
  54. data/test/soap/header/test_authheader_cgi.rb +1 -1
  55. data/test/soap/header/test_simplehandler.rb +1 -1
  56. data/test/soap/helloworld/test_helloworld.rb +3 -2
  57. data/test/soap/literalArrayMapping/test_definedarray.rb +2 -2
  58. data/test/soap/marshal/marshaltestlib.rb +5 -2
  59. data/test/soap/marshal/test_digraph.rb +1 -1
  60. data/test/soap/marshal/test_marshal.rb +3 -2
  61. data/test/soap/marshal/test_struct.rb +1 -1
  62. data/test/soap/ssl/sslsvr.rb +1 -0
  63. data/test/soap/ssl/test_ssl.rb +1 -1
  64. data/test/soap/struct/test_struct.rb +2 -2
  65. data/test/soap/swa/test_file.rb +1 -1
  66. data/test/soap/test_basetype.rb +1 -1
  67. data/test/soap/test_cookie.rb +2 -2
  68. data/test/soap/test_custom_ns.rb +4 -4
  69. data/test/soap/test_custommap.rb +1 -1
  70. data/test/soap/test_empty.rb +6 -6
  71. data/test/soap/test_envelopenamespace.rb +2 -2
  72. data/test/soap/test_extraattr.rb +2 -2
  73. data/test/soap/test_generator.rb +5 -3
  74. data/test/soap/test_httpconfigloader.rb +1 -1
  75. data/test/soap/test_mapping.rb +1 -1
  76. data/test/soap/test_nestedexception.rb +28 -14
  77. data/test/soap/test_nil.rb +23 -28
  78. data/test/soap/test_no_indent.rb +3 -3
  79. data/test/soap/test_property.rb +2 -2
  80. data/test/soap/test_response_as_xml.rb +4 -4
  81. data/test/soap/test_soapelement.rb +1 -1
  82. data/test/soap/test_streamhandler.rb +2 -2
  83. data/test/soap/test_styleuse.rb +2 -2
  84. data/test/soap/wsdlDriver/test_calc.rb +2 -2
  85. data/test/soap/wsdlDriver/test_document.rb +2 -2
  86. data/test/soap/wsdlDriver/test_simpletype.rb +3 -2
  87. data/test/testutil.rb +4 -4
  88. data/test/wsdl/abstract/test_abstract.rb +2 -2
  89. data/test/wsdl/anonymous/test_anonymous.rb +2 -2
  90. data/test/wsdl/any/test_any.rb +2 -2
  91. data/test/wsdl/axisArray/test_axisarray.rb +2 -2
  92. data/test/wsdl/choice/test_choice.rb +2 -2
  93. data/test/wsdl/complexcontent/test_echo.rb +2 -2
  94. data/test/wsdl/datetime/test_datetime.rb +3 -2
  95. data/test/wsdl/document/array/test_array.rb +2 -2
  96. data/test/wsdl/document/test_nosoapaction.rb +2 -2
  97. data/test/wsdl/document/test_number.rb +2 -2
  98. data/test/wsdl/document/test_rpc.rb +2 -2
  99. data/test/wsdl/fault/multifault.wsdl +8 -8
  100. data/test/wsdl/fault/test_fault.rb +3 -3
  101. data/test/wsdl/fault/test_multifault.rb +13 -13
  102. data/test/wsdl/group/test_rpc.rb +2 -2
  103. data/test/wsdl/list/test_list.rb +2 -2
  104. data/test/wsdl/map/test_map.rb +1 -1
  105. data/test/wsdl/marshal/test_wsdlmarshal.rb +3 -4
  106. data/test/wsdl/oneway/test_oneway.rb +2 -2
  107. data/test/wsdl/overload/test_overload.rb +2 -2
  108. data/test/wsdl/qualified/test_qualified.rb +4 -4
  109. data/test/wsdl/qualified/test_unqualified.rb +4 -4
  110. data/test/wsdl/raa/test_raa.rb +4 -4
  111. data/test/wsdl/ref/test_ref.rb +2 -2
  112. data/test/wsdl/rpc/test_rpc.rb +2 -2
  113. data/test/wsdl/rpc/test_rpc_lit.rb +18 -18
  114. data/test/wsdl/simplecontent/test_simplecontent.rb +2 -2
  115. data/test/wsdl/simpletype/rpc/test_rpc.rb +2 -2
  116. data/test/wsdl/simpletype/test_simpletype.rb +2 -2
  117. data/test/wsdl/soap/test_soapbodyparts.rb +1 -1
  118. data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +2 -2
  119. data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +2 -2
  120. data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +2 -2
  121. data/test/wsdl/soaptype/test_soaptype.rb +5 -5
  122. data/test/wsdl/test_emptycomplextype.rb +1 -1
  123. data/test/wsdl/test_fault.rb +1 -1
  124. data/test/wsdl/test_multiplefault.rb +1 -1
  125. data/test/xsd/codegen/test_classdef.rb +1 -1
  126. data/test/xsd/test_noencoding.rb +1 -1
  127. data/test/xsd/test_ns.rb +1 -1
  128. data/test/xsd/test_xmlschemaparser.rb +1 -1
  129. data/test/xsd/test_xsd.rb +1 -1
  130. data/test/xsd/xsd2ruby/test_xsd2ruby.rb +3 -3
  131. metadata +24 -33
  132. data/lib/soap/rpc/element.rb.orig +0 -378
  133. data/lib/soap/ruby18ext.rb +0 -13
  134. data/lib/xsd/xmlparser.rb.orig +0 -110
  135. data/test/results +0 -4810
  136. data/test/soap/header/session.pstoredb +0 -0
  137. data/test/wsdl/marshal/Person.rb +0 -1
  138. data/test/wsdl/simpletype/rpc/echo_version.rb +0 -1
  139. data/test/wsdl/simpletype/rpc/echo_versionDriver.rb +0 -10
  140. data/test/wsdl/simpletype/rpc/echo_versionMappingRegistry.rb +0 -4
  141. data/test/wsdl/simpletype/rpc/echo_versionServant.rb +0 -3
  142. data/test/wsdl/simpletype/rpc/echo_version_service.rb +0 -3
  143. data/test/wsdl/simpletype/rpc/echo_version_serviceClient.rb +0 -34
  144. data/test/wsdl/soap/wsdl2ruby/echo_version.rb +0 -1
  145. data/test/wsdl/soap/wsdl2ruby/echo_versionDriver.rb +0 -10
  146. data/test/wsdl/soap/wsdl2ruby/echo_versionMappingRegistry.rb +0 -4
  147. data/test/wsdl/soap/wsdl2ruby/echo_versionServant.rb +0 -3
  148. data/test/wsdl/soap/wsdl2ruby/echo_version_service.cgi +0 -3
  149. data/test/wsdl/soap/wsdl2ruby/echo_version_service.rb +0 -7
  150. data/test/wsdl/soap/wsdl2ruby/echo_version_serviceClient.rb +0 -34
data/bin/wsdl2ruby.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ $:.unshift File.join(File.dirname(__FILE__),'../lib') if ENV['DEBUG_SOAP4R']
2
3
 
3
4
  require 'getoptlong'
4
5
  require 'logger'
data/bin/xsd2ruby.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
+ $:.unshift File.join(File.dirname(__FILE__),'../lib') if ENV['DEBUG_SOAP4R']
2
3
 
3
4
  require 'getoptlong'
4
5
  require 'logger'
5
6
  require 'wsdl/xmlSchema/xsd2ruby'
6
7
 
7
-
8
8
  class XSD2RubyApp < Logger::Application
9
9
  private
10
10
 
data/lib/soap/baseData.rb CHANGED
@@ -1079,7 +1079,7 @@ private
1079
1079
  "#{typename}[" << ',' * (rank - 1) << ']'
1080
1080
  end
1081
1081
 
1082
- TypeParseRegexp = Regexp.new('^(.+)\[([\d,]*)\]$')
1082
+ TypeParseRegexp = Regexp.new('^(.+)\[([\d,]*)\]$', nil, 'n')
1083
1083
 
1084
1084
  def self.parse_type(string)
1085
1085
  TypeParseRegexp =~ string
data/lib/soap/element.rb CHANGED
@@ -103,8 +103,6 @@ class SOAPBody < SOAPStruct
103
103
  if data
104
104
  if data.respond_to?(:to_xmlpart)
105
105
  data = SOAP::SOAPRawData.new(data)
106
- elsif defined?(::Nokogiri) and data.is_a?(::Nokogiri::XML::Document)
107
- data = SOAP::SOAPRawData.new(SOAP::SOAPREXMLElementWrap.new(data.children[0]))
108
106
  elsif defined?(::REXML) and data.is_a?(::REXML::Element)
109
107
  data = SOAP::SOAPRawData.new(SOAP::SOAPREXMLElementWrap.new(data))
110
108
  end
@@ -269,8 +269,7 @@ private
269
269
  end
270
270
 
271
271
  def get_encode_char_regexp
272
- ENCODE_CHAR_REGEXP[XSD::Charset.encoding] ||=
273
- Regexp.new("[#{EncodeMap.keys.join}]")
272
+ ENCODE_CHAR_REGEXP[XSD::Charset.encoding] ||= Regexp.new("[#{EncodeMap.keys.join}]", nil, (RUBY_VERSION.to_f >= 1.9) ? 'n' : XSD::Charset.encoding) # RubyJedi: compatible with Ruby 1.8.6 and above
274
273
  end
275
274
 
276
275
  def find_handler(encodingstyle)
@@ -463,6 +463,7 @@ private
463
463
  else
464
464
  child = Mapping.get_attribute(obj, eledef.varname)
465
465
  if child.respond_to?(:each) and eledef.as_array?
466
+ child = child.lines if child.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
466
467
  child.each do |item|
467
468
  ele.add(name, typedobj2soap(item, eledef.mapped_class))
468
469
  end
@@ -37,12 +37,12 @@ class Factory
37
37
  end
38
38
 
39
39
  def setiv2soap(node, obj, map)
40
- if obj.class.class_variables.include?(:@@schema_element)
40
+ if obj.class.class_variables.include?('@@schema_element')
41
41
  setdefinediv2soap(node, obj, map)
42
42
  else
43
43
  # should we sort instance_variables? how?
44
44
  obj.instance_variables.each do |var|
45
- name = var.to_s.sub(/^@/, '').to_sym
45
+ name = var.to_s.sub(/^@/, '')
46
46
  elename = Mapping.name2elename(name)
47
47
  node.add(elename,
48
48
  Mapping._obj2soap(obj.instance_variable_get(var), map))
@@ -165,10 +165,9 @@ module Mapping
165
165
  # ex. a.b => a.2eb
166
166
  #
167
167
  def self.name2elename(name)
168
- name = name.to_s
169
- name.gsub(/([^a-zA-Z0-9:_\-]+)/n) {
168
+ name.to_s.gsub(/([^a-zA-Z0-9:_\-]+)/n) {
170
169
  '.' << $1.unpack('H2' * $1.size).join('.')
171
- }.gsub(/::/n, '..').to_sym
170
+ }.gsub(/::/n, '..')
172
171
  end
173
172
 
174
173
  def self.elename2name(name)
@@ -541,7 +540,7 @@ module Mapping
541
540
  private
542
541
 
543
542
  def class_schema_variable(sym, klass)
544
- var = "@@#{sym}".to_sym
543
+ var = "@@#{sym}"
545
544
  klass.class_variables.include?(var) ? klass.class_eval(var) : nil
546
545
  end
547
546
 
@@ -50,21 +50,6 @@ class Object
50
50
  @__xmlele
51
51
  end
52
52
 
53
- def to_hash
54
- result = {}
55
- @__xmlele.each do |qname, value|
56
- result[qname.name.to_sym] = begin
57
- case value
58
- when SOAP::Mapping::Object
59
- value.to_hash
60
- else
61
- value
62
- end
63
- end
64
- end
65
- result
66
- end
67
-
68
53
  def [](qname)
69
54
  qname = Mapping.to_qname(qname)
70
55
  @__xmlele.each do |k, v|
@@ -5,7 +5,6 @@
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
6
6
  # either the dual license version in 2003, or any later version.
7
7
 
8
- #require 'continuation'
9
8
 
10
9
  module SOAP
11
10
  module Mapping
@@ -123,8 +123,8 @@ private
123
123
  end
124
124
 
125
125
  def simpleobj2soap(obj, type)
126
- return SOAPNil.new unless obj
127
126
  type.check_lexical_format(obj)
127
+ return SOAPNil.new if obj.nil? # TODO: check nillable.
128
128
  if type.base
129
129
  ele = base2soap(obj, TypeMap[type.base])
130
130
  ele.type = type.name
@@ -49,6 +49,7 @@ class MIMEMessage
49
49
 
50
50
  def parse(str)
51
51
  header_cache = nil
52
+ str = str.lines if str.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
52
53
  str.each do |line|
53
54
  case line
54
55
  when /^\A[^\: \t]+:\s*.+$/
@@ -20,7 +20,7 @@ module NestedException
20
20
  end
21
21
 
22
22
  def set_backtrace(backtrace)
23
- if @cause and @cause.respond_to?(:backtrace)
23
+ if defined?(@cause) and @cause.respond_to?(:backtrace)
24
24
  @original_backtrace = backtrace
25
25
  =begin
26
26
  # for agressive backtrace abstraction: 'here' only should not be good
@@ -176,13 +176,13 @@ private
176
176
  http.open_timeout = @connect_timeout if @connect_timeout
177
177
  http.read_timeout = @receive_timeout if @receive_timeout
178
178
  case url
179
- when URI::HTTPS then
179
+ when URI::HTTPS
180
180
  if SSLEnabled
181
- http.use_ssl = true
181
+ http.use_ssl = true
182
182
  else
183
- raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)")
183
+ raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)")
184
184
  end
185
- when URI::HTTP then
185
+ when URI::HTTP
186
186
  # OK
187
187
  else
188
188
  raise RuntimeError.new("Cannot connect to #{url} (Not HTTP.)")
data/lib/soap/ns.rb CHANGED
@@ -13,6 +13,10 @@ require 'soap/soap'
13
13
 
14
14
  module SOAP
15
15
 
16
+ ## Rubyjedi: Provide these (deprecated) constants for backward compatibility with older ActionWebService
17
+ SOAPNamespaceTag = 'env'
18
+ XSDNamespaceTag = 'xsd'
19
+ XSINamespaceTag = 'xsi'
16
20
 
17
21
  class NS < XSD::NS
18
22
  KNOWN_TAG = XSD::NS::KNOWN_TAG.dup.update(
data/lib/soap/property.rb CHANGED
@@ -65,12 +65,18 @@ class Property
65
65
 
66
66
  KEY_REGSRC = '([^=:\\\\]*(?:\\\\.[^=:\\\\]*)*)'
67
67
  DEF_REGSRC = '\\s*' + KEY_REGSRC + '\\s*[=:]\\s*(.*)'
68
- COMMENT_REGEXP = Regexp.new("^(?:#.*|)$")
69
- CATDEF_REGEXP = Regexp.new("^\\[\\s*#{KEY_REGSRC}\\s*\\]$")
70
- LINE_REGEXP = Regexp.new("^#{DEF_REGSRC}$")
68
+ #COMMENT_REGEXP = Regexp.new('^(?:#.*|)$', nil, 'u')
69
+ #CATDEF_REGEXP = Regexp.new("^\\[\\s*#{KEY_REGSRC}\\s*\\]$", nil, 'u')
70
+ #LINE_REGEXP = Regexp.new("^#{DEF_REGSRC}$", nil, 'u')
71
+
72
+ COMMENT_REGEXP = Regexp.new('^(?:#.*|)$') # RubyJedi: Attempt at 1.9 Compatibility // , nil, 'u')
73
+ CATDEF_REGEXP = Regexp.new("^\\[\\s*#{KEY_REGSRC}\\s*\\]$") # RubyJedi: Attempt at 1.9 Compatibility // , nil, 'u')
74
+ LINE_REGEXP = Regexp.new("^#{DEF_REGSRC}$") # RubyJedi: Attempt at 1.9 Compatibility // , nil, 'u')
75
+
71
76
  def load(stream)
72
77
  key_prefix = ""
73
- stream.each_line.each_with_index do |line, lineno|
78
+ stream = stream.lines if stream.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
79
+ stream.each_with_index do |line, lineno|
74
80
  line.sub!(/\r?\n\z/u, '')
75
81
  case line
76
82
  when COMMENT_REGEXP
@@ -320,14 +326,14 @@ end
320
326
 
321
327
 
322
328
  # for ruby/1.6.
323
- unless Enumerable.method_defined?(:inject)
324
- module Enumerable
325
- def inject(init)
326
- result = init
327
- each do |item|
328
- result = yield(result, item)
329
- end
330
- result
331
- end
332
- end
333
- end
329
+ #unless Enumerable.instance_methods.include?(:inject)
330
+ # module Enumerable
331
+ # def inject(init)
332
+ # result = init
333
+ # each do |item|
334
+ # result = yield(result, item)
335
+ # end
336
+ # result
337
+ # end
338
+ # end
339
+ #end
@@ -230,7 +230,7 @@ private
230
230
  mapped_class = SOAPMethod.parse_mapped_class(param.mapped_class)
231
231
  qname = param.qname
232
232
  if qname.nil? and mapped_class
233
- qname = TypeMap.key(mapped_class)
233
+ qname = TypeMap.respond_to?(:key) ? TypeMap.key(mapped_class) : TypeMap.index(mapped_class) # RubyJedi: compatible with Ruby 1.8.6 and above
234
234
  end
235
235
  case param.io_type
236
236
  when IN
@@ -14,7 +14,7 @@ module RPC
14
14
 
15
15
 
16
16
  class StandaloneServer < HTTPServer
17
- def initialize(appname, default_namespace, host = "0.0.0.0", port = 8089)
17
+ def initialize(appname, default_namespace, host = "0.0.0.0", port = 8080)
18
18
  @appname = appname
19
19
  @default_namespace = default_namespace
20
20
  @host = host
data/lib/soap/soap.rb CHANGED
@@ -5,16 +5,18 @@
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
6
6
  # either the dual license version in 2003, or any later version.
7
7
 
8
- require 'soap/ruby18ext'
8
+
9
9
  require 'xsd/qname'
10
10
  require 'xsd/charset'
11
11
  require 'soap/nestedexception'
12
+ require 'soap/version'
12
13
 
13
14
 
14
15
  module SOAP
15
16
 
16
17
 
17
- VERSION = Version = '1.6.1-SNAPSHOT'
18
+ # VERSION = Version = SOAP::VERSION::STRING # '1.5.8-HEAD'
19
+ Version = SOAP::VERSION::STRING # '1.5.8-HEAD'
18
20
  PropertyName = 'soap/property'
19
21
 
20
22
  EnvelopeNamespace = 'http://schemas.xmlsoap.org/soap/envelope/'
@@ -142,7 +142,7 @@ public
142
142
 
143
143
  def initialize(options)
144
144
  super()
145
- @client = Client.new(nil, "SOAP4R/#{ Version }")
145
+ @client = Client.new(nil, "RUBYJEDI-SOAP4R/#{ Version }")
146
146
  if @client.respond_to?(:request_filter)
147
147
  @client.request_filter << HttpPostRequestFilter.new(@filterchain)
148
148
  end
@@ -0,0 +1,8 @@
1
+ module SOAP
2
+ module VERSION #:nodoc:
3
+ MAJOR = 1
4
+ MINOR = 5
5
+ TINY = 8
6
+ STRING = [MAJOR, MINOR, TINY].join('.')
7
+ end
8
+ end
@@ -5,7 +5,7 @@
5
5
  # redistribute it and/or modify it under the same terms of Ruby's license;
6
6
  # either the dual license version in 2003, or any later version.
7
7
 
8
- require 'soap/ruby18ext'
8
+
9
9
  require 'wsdl/parser'
10
10
  require 'wsdl/importer'
11
11
  require 'xsd/qname'
@@ -124,7 +124,7 @@ private
124
124
 
125
125
  def add_operation(drv, binding)
126
126
  name_creator = WSDL::SOAP::ClassNameCreator.new
127
- modulepath = %w(WSDLDriverFactory)
127
+ modulepath = 'WSDLDriverFactory'
128
128
  methoddefcreator =
129
129
  WSDL::SOAP::MethodDefCreator.new(@wsdl, name_creator, modulepath, {})
130
130
  mdefs = methoddefcreator.create(binding.name)
data/lib/wsdl/parser.rb CHANGED
@@ -113,10 +113,10 @@ private
113
113
  elename = ns.parse(name)
114
114
  if !parent
115
115
  if elename == DefinitionsName
116
- o = Definitions.parse_element(elename)
116
+ o = Definitions.parse_element(elename)
117
117
  o.location = @location
118
118
  else
119
- raise UnknownElementError.new("unknown element: #{elename}")
119
+ raise UnknownElementError.new("unknown element: #{elename}")
120
120
  end
121
121
  o.root = @originalroot if @originalroot # o.root = o otherwise
122
122
  else
@@ -128,10 +128,10 @@ private
128
128
  end
129
129
  if o.nil?
130
130
  unless @ignored.key?(elename)
131
- warn("ignored element: #{elename} : #{parent.inspect}")
131
+ warn("ignored element: #{elename}")
132
132
  @ignored[elename] = elename
133
133
  end
134
- o = Documentation.new # which accepts any element.
134
+ o = Documentation.new # which accepts any element.
135
135
  end
136
136
  # node could be a pseudo element. pseudo element has its own parent.
137
137
  o.root = parent.root
@@ -51,7 +51,7 @@ module ClassDefCreatorSupport
51
51
  #
52
52
  __EOD__
53
53
  unless fault.empty?
54
- str <<<<__EOD__
54
+ str += <<__EOD__
55
55
  # RAISES
56
56
  #{dump_fault_type(fault, element_definitions)}
57
57
  #
@@ -33,7 +33,8 @@ class ClientSkeltonCreator
33
33
  result = ""
34
34
  if @modulepath
35
35
  result << "\n"
36
- result << @modulepath.collect { |ele| "module #{ele}" }.join("; ")
36
+ modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
37
+ result << modulepath.collect { |ele| "module #{ele}" }.join("; ")
37
38
  result << "\n\n"
38
39
  end
39
40
  services.ports.each do |port|
@@ -42,7 +43,8 @@ class ClientSkeltonCreator
42
43
  end
43
44
  if @modulepath
44
45
  result << "\n\n"
45
- result << @modulepath.collect { |ele| "end" }.join("; ")
46
+ modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
47
+ result << modulepath.collect { |ele| "end" }.join("; ")
46
48
  result << "\n"
47
49
  end
48
50
  result
@@ -33,7 +33,8 @@ class DriverCreator
33
33
  def dump(porttype = nil)
34
34
  result = "require 'soap/rpc/driver'\n\n"
35
35
  if @modulepath
36
- @modulepath.each do |name|
36
+ modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
37
+ modulepath.each do |name|
37
38
  result << "module #{name}\n"
38
39
  end
39
40
  result << "\n"
@@ -48,7 +49,8 @@ class DriverCreator
48
49
  end
49
50
  if @modulepath
50
51
  result << "\n"
51
- @modulepath.each do |name|
52
+ modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
53
+ modulepath.each do |name|
52
54
  result << "end\n"
53
55
  end
54
56
  end
@@ -165,7 +165,7 @@ __EOD__
165
165
  elsif definedtype = @complextypes[part.type]
166
166
  return ['::SOAP::SOAPElement', part.type]
167
167
  else
168
- # raise RuntimeError.new("part: #{part.name} cannot be resolved")
168
+ raise RuntimeError.new("part: #{part.name} cannot be resolved")
169
169
  end
170
170
  end
171
171
 
@@ -31,7 +31,8 @@ class ServantSkeltonCreator
31
31
  result = ""
32
32
  if @modulepath
33
33
  result << "\n"
34
- result << @modulepath.collect { |ele| "module #{ele}" }.join("; ")
34
+ modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
35
+ result << modulepath.collect { |ele| "module #{ele}" }.join("; ")
35
36
  result << "\n\n"
36
37
  end
37
38
  if porttype.nil?
@@ -44,7 +45,8 @@ class ServantSkeltonCreator
44
45
  end
45
46
  if @modulepath
46
47
  result << "\n\n"
47
- result << @modulepath.collect { |ele| "end" }.join("; ")
48
+ modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
49
+ result << modulepath.collect { |ele| "end" }.join("; ")
48
50
  result << "\n"
49
51
  end
50
52
  result
@@ -58,7 +58,7 @@ private
58
58
  end
59
59
 
60
60
  def create_file
61
- @modulepath = Array(@opt['module_path'])
61
+ @modulepath = @opt['module_path']
62
62
  create_classdef if @opt.key?('classdef')
63
63
  create_mapping_registry if @opt.key?('mapping_registry')
64
64
  create_servant_skelton(@opt['servant_skelton']) if @opt.key?('servant_skelton')
@@ -111,10 +111,10 @@ private
111
111
  elename = ns.parse(name)
112
112
  if !parent
113
113
  if elename == SchemaName
114
- o = Schema.parse_element(elename)
114
+ o = Schema.parse_element(elename)
115
115
  o.location = @location
116
116
  else
117
- raise UnknownElementError.new("unknown element: #{elename}")
117
+ raise UnknownElementError.new("unknown element: #{elename}")
118
118
  end
119
119
  o.root = @originalroot if @originalroot # o.root = o otherwise
120
120
  else
@@ -129,7 +129,7 @@ private
129
129
  warn("ignored element: #{elename} of #{parent.class}")
130
130
  @ignored[elename] = elename
131
131
  end
132
- o = Documentation.new # which accepts any element.
132
+ o = Documentation.new # which accepts any element.
133
133
  end
134
134
  # node could be a pseudo element. pseudo element has its own parent.
135
135
  o.root = parent.root
@@ -140,7 +140,7 @@ private
140
140
  value_ele = ns.parse(value, false)
141
141
  value_ele.source = value # for recovery; value may not be a QName
142
142
  if attr_ele == IdAttrName
143
- o.id = value_ele
143
+ o.id = value_ele
144
144
  else
145
145
  if o.parse_attr(attr_ele, value_ele).nil?
146
146
  unless @ignored.key?(attr_ele)