summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-01 10:58:17 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-01 10:58:17 +0000
commitb37f4923e5f63a0e4988f82dce8f48fbb2b6f184 (patch)
treefe4af625746e857d224e7ff1c407cd6259757fda /lib
parent9db6fb5ce56ee2e911944377edb02cb493e428b1 (diff)
* lib/soap/mapping/{factory.rb,registry.rb}: fixed illegal mapped URI
object with soap/marshal. added URIFactory class for URI mapping. BasetypeFactory checks instance_variables when original mapping is not allowed (ivar must be empty). Instance of URI have instance_variables but it must be llowed whenever original mapping is allowed or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/soap/mapping/factory.rb14
-rw-r--r--lib/soap/mapping/registry.rb5
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/soap/mapping/factory.rb b/lib/soap/mapping/factory.rb
index bf68701229..fe6a6de7ae 100644
--- a/lib/soap/mapping/factory.rb
+++ b/lib/soap/mapping/factory.rb
@@ -220,6 +220,20 @@ class Base64Factory_ < Factory
end
end
+class URIFactory_ < Factory
+ def obj2soap(soap_class, obj, info, map)
+ soap_obj = soap_class.new(obj)
+ mark_marshalled_obj(obj, soap_obj) if soap_obj
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = node.data
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+end
+
class ArrayFactory_ < Factory
def initialize(allow_original_mapping = false)
super()
diff --git a/lib/soap/mapping/registry.rb b/lib/soap/mapping/registry.rb
index 46a04e368f..8142047724 100644
--- a/lib/soap/mapping/registry.rb
+++ b/lib/soap/mapping/registry.rb
@@ -186,6 +186,7 @@ class Registry
DateTimeFactory = DateTimeFactory_.new
ArrayFactory = ArrayFactory_.new
Base64Factory = Base64Factory_.new
+ URIFactory = URIFactory_.new
TypedArrayFactory = TypedArrayFactory_.new
TypedStructFactory = TypedStructFactory_.new
@@ -213,7 +214,7 @@ class Registry
{:derived_class => true}],
[::Integer, ::SOAP::SOAPShort, BasetypeFactory,
{:derived_class => true}],
- [::URI::Generic, ::SOAP::SOAPAnyURI, BasetypeFactory,
+ [::URI::Generic, ::SOAP::SOAPAnyURI, URIFactory,
{:derived_class => true}],
[::String, ::SOAP::SOAPBase64, Base64Factory],
[::String, ::SOAP::SOAPHexBinary, Base64Factory],
@@ -259,7 +260,7 @@ class Registry
{:derived_class => true}],
[::Integer, ::SOAP::SOAPShort, BasetypeFactory,
{:derived_class => true}],
- [::URI::Generic, ::SOAP::SOAPAnyURI, BasetypeFactory,
+ [::URI::Generic, ::SOAP::SOAPAnyURI, URIFactory,
{:derived_class => true}],
[::String, ::SOAP::SOAPBase64, Base64Factory],
[::String, ::SOAP::SOAPHexBinary, Base64Factory],