summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-08 09:52:42 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-08 09:52:42 +0000
commit660e839bb8ffd74308b56f100e05f7f141aa00ac (patch)
tree4455d91a96cc91f03858ef6c517e9b7d7dbbf119 /lib
parentc18d7d2f0b7fc96b71e02c166bdd37da945b2511 (diff)
downloadruby-660e839bb8ffd74308b56f100e05f7f141aa00ac.tar.gz
ruby-660e839bb8ffd74308b56f100e05f7f141aa00ac.tar.xz
ruby-660e839bb8ffd74308b56f100e05f7f141aa00ac.zip
* test/wsdl/raa/*: add new testcase for WSDL loading, parsing and reading.
* test/soap/marshal/*: backport from soap4r/1.5.1. all differences are for ruby/1.6. * lib/soap/*: backport from soap4r/1.5.1. all differences are for ruby/1.6. * lib/wsdl/data.rb, lib/wsdl/xmlSchema/data.rb: move definition of ArrayTypeAttrName from ::WSDL::XMLSchema::* to ::WSDL::*. [ruby-talk:84813] * lib/wsdl/soap/definitions.rb: element name typo in custom exception struct definition which is needed for wsdlDriver; camelCase -> underscore_name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/soap/mapping/factory.rb23
-rw-r--r--lib/soap/mapping/registry.rb19
-rw-r--r--lib/soap/soap.rb2
-rw-r--r--lib/wsdl/data.rb1
-rw-r--r--lib/wsdl/soap/definitions.rb2
-rw-r--r--lib/wsdl/xmlSchema/data.rb1
6 files changed, 39 insertions, 9 deletions
diff --git a/lib/soap/mapping/factory.rb b/lib/soap/mapping/factory.rb
index 92ed194a4..631c16113 100644
--- a/lib/soap/mapping/factory.rb
+++ b/lib/soap/mapping/factory.rb
@@ -44,10 +44,29 @@ class Factory
klass.allocate
end
else
+ MARSHAL_TAG = {
+ String => ['"', 1],
+ Regexp => ['/', 2],
+ Array => ['[', 1],
+ Hash => ['{', 1]
+ }
def create_empty_object(klass)
+ if klass <= Struct
+ name = klass.name
+ return ::Marshal.load(sprintf("\004\006S:%c%s\000", name.length + 5, name))
+ end
+ if MARSHAL_TAG.has_key?(klass)
+ tag, terminate = MARSHAL_TAG[klass]
+ return ::Marshal.load(sprintf("\004\006%s%s", tag, "\000" * terminate))
+ end
+ MARSHAL_TAG.each do |k, v|
+ if klass < k
+ name = klass.name
+ tag, terminate = v
+ return ::Marshal.load(sprintf("\004\006C:%c%s%s%s", name.length + 5, name, tag, "\000" * terminate))
+ end
+ end
name = klass.name
- # Below line is from TANAKA, Akira's amarshal.rb.
- # See http://cvs.m17n.org/cgi-bin/viewcvs/amarshal/?cvsroot=ruby
::Marshal.load(sprintf("\004\006o:%c%s\000", name.length + 5, name))
end
end
diff --git a/lib/soap/mapping/registry.rb b/lib/soap/mapping/registry.rb
index bdf14d4fc..e98c98a6d 100644
--- a/lib/soap/mapping/registry.rb
+++ b/lib/soap/mapping/registry.rb
@@ -426,10 +426,21 @@ private
Mapping.set_instance_vars(obj, vars)
end
- def addextend2obj(obj, attr)
- return unless attr
- attr.split(/ /).reverse_each do |mstr|
- obj.extend(Mapping.class_from_name(mstr))
+ if RUBY_VERSION >= '1.8.0'
+ def addextend2obj(obj, attr)
+ return unless attr
+ attr.split(/ /).reverse_each do |mstr|
+ obj.extend(Mapping.class_from_name(mstr))
+ end
+ end
+ else
+ # (class < false; self; end).ancestors includes "TrueClass" under 1.6...
+ def addextend2obj(obj, attr)
+ return unless attr
+ attr.split(/ /).reverse_each do |mstr|
+ m = Mapping.class_from_name(mstr)
+ obj.extend(m) if m.class == Module
+ end
end
end
diff --git a/lib/soap/soap.rb b/lib/soap/soap.rb
index 313af3a05..2543ec361 100644
--- a/lib/soap/soap.rb
+++ b/lib/soap/soap.rb
@@ -24,7 +24,7 @@ require 'xsd/charset'
module SOAP
-Version = '1.5.0'
+Version = '1.5.1'
EnvelopeNamespace = 'http://schemas.xmlsoap.org/soap/envelope/'
EncodingNamespace = 'http://schemas.xmlsoap.org/soap/encoding/'
diff --git a/lib/wsdl/data.rb b/lib/wsdl/data.rb
index 4f3b84531..3361dac1f 100644
--- a/lib/wsdl/data.rb
+++ b/lib/wsdl/data.rb
@@ -35,6 +35,7 @@ require 'wsdl/import'
module WSDL
+ArrayTypeAttrName = XSD::QName.new(Namespace, 'arrayType')
BindingName = XSD::QName.new(Namespace, 'binding')
DefinitionsName = XSD::QName.new(Namespace, 'definitions')
DocumentationName = XSD::QName.new(Namespace, 'documentation')
diff --git a/lib/wsdl/soap/definitions.rb b/lib/wsdl/soap/definitions.rb
index 08df0dcc6..1bd8e8a66 100644
--- a/lib/wsdl/soap/definitions.rb
+++ b/lib/wsdl/soap/definitions.rb
@@ -117,7 +117,7 @@ private
def exception_complextype
type = XMLSchema::ComplexType.new(XSD::QName.new(
::SOAP::Mapping::RubyCustomTypeNamespace, 'SOAPException'))
- excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'exceptionTypeName'), XSD::XSDString::Type)
+ excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'excn_type_name'), XSD::XSDString::Type)
cause = XMLSchema::Element.new(XSD::QName.new(nil, 'cause'), XSD::AnyTypeName)
backtrace = XMLSchema::Element.new(XSD::QName.new(nil, 'backtrace'), ::SOAP::ValueArrayName)
message = XMLSchema::Element.new(XSD::QName.new(nil, 'message'), XSD::XSDString::Type)
diff --git a/lib/wsdl/xmlSchema/data.rb b/lib/wsdl/xmlSchema/data.rb
index 539cf357c..57d2f527c 100644
--- a/lib/wsdl/xmlSchema/data.rb
+++ b/lib/wsdl/xmlSchema/data.rb
@@ -36,7 +36,6 @@ module XMLSchema
AllName = XSD::QName.new(XSD::Namespace, 'all')
AnyName = XSD::QName.new(XSD::Namespace, 'any')
-ArrayTypeAttrName = XSD::QName.new(XSD::Namespace, 'arrayType')
AttributeName = XSD::QName.new(XSD::Namespace, 'attribute')
ChoiceName = XSD::QName.new(XSD::Namespace, 'choice')
ComplexContentName = XSD::QName.new(XSD::Namespace, 'complexContent')