summaryrefslogtreecommitdiff
path: root/lib/soap/encodingstyle
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-06 02:20:51 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-06 02:20:51 +0000
commitff1b89a96d0f103ff0c917c458ddd3e36e9b3718 (patch)
tree5449bd61cebdf6486cb443c0013a8573204fb50c /lib/soap/encodingstyle
parent8a8dd6519948eaf207f03c12152fc160de7370a2 (diff)
* import soap4r/1.5.2;
* lib/soap/{attachment.rb,baseData.rb,encodingstyle/soapHandler.rb}: introduce SOAPExternalReference class as a referenct to SOAPEnvelope external content. * lib/soap/{attachment.rb,mimemessage.rb}: great SwA (SOAP messages with Attachments) support code by Jamie Herre. * lib/soap/{element.rb,marshal.rb,parser.rb,processor.rb, streamHandler.rb,wsdlDriver.rb}: SwA support. * lib/soap/rpc/{cgistub.rb,driver.rb,element.rb,proxy.rb,router.rb, soaplet.rb}: SwA support and refactoring. * lib/soap/generator.rb, lib/soap/mapping/mapping.rb: follow SOAPReference#initialize signature change. * lib/soap/mapping/factory.rb: deleted unused methods. * lib/soap/mapping/rubytypeFactory.rb: do no ignore case while xsi:type string <-> Ruby class name matching. * lib/xsd/datatypes.rb: check the smallest positive non-zero single-precision float exactly instead of packing with "f". [ruby-talk:88822] * test/soap/test_basetype.rb, test/xsd/test_xsd.rb: use 1.402e-45, not 1.4e-45. 1.4e-45 is smaller than 2 ** -149... * test/soap/test_basetype.rb, test/soap/marshal/test_marshal.rb, test/xsd/test_xsd.rb: use "(-1.0 / (1.0 / 0.0))" instead of "-0.0". * test/soap/test_streamhandler.rb: revert to the previous test that warns "basic_auth unsupported under net/http". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/soap/encodingstyle')
-rw-r--r--lib/soap/encodingstyle/soapHandler.rb30
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/soap/encodingstyle/soapHandler.rb b/lib/soap/encodingstyle/soapHandler.rb
index 9aa732535e..d755d7b952 100644
--- a/lib/soap/encodingstyle/soapHandler.rb
+++ b/lib/soap/encodingstyle/soapHandler.rb
@@ -46,14 +46,19 @@ class SOAPHandler < Handler
case data
when SOAPReference
- attrs['href'] = '#' << data.refid
+ attrs['href'] = data.refidstr
+ generator.encode_tag(name, attrs)
+ when SOAPExternalReference
+ data.referred
+ attrs['href'] = data.refidstr
generator.encode_tag(name, attrs)
when SOAPRawString
generator.encode_tag(name, attrs)
generator.encode_rawstring(data.to_s)
when XSD::XSDString
generator.encode_tag(name, attrs)
- generator.encode_string(@charset ? XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s)
+ generator.encode_string(@charset ?
+ XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s)
when XSD::XSDAnySimpleType
generator.encode_tag(name, attrs)
generator.encode_string(data.to_s)
@@ -320,10 +325,9 @@ private
def encode_attr_value(generator, ns, qname, value)
if value.is_a?(SOAPType)
- refid = SOAPReference.create_refid(value)
- value.id = refid
+ ref = SOAPReference.new(value)
generator.add_reftarget(qname.name, value)
- '#' + refid
+ ref.refidstr
else
value.to_s
end
@@ -526,7 +530,7 @@ private
def decode_attr_value(ns, qname, value)
if /\A#/ =~ value
- o = SOAPReference.new(value)
+ o = SOAPReference.decode(nil, value)
@refpool << o
o
else
@@ -544,16 +548,18 @@ private
while !@refpool.empty? && count > 0
@refpool = @refpool.find_all { |ref|
o = @idpool.find { |item|
- '#' + item.id == ref.refid
+ item.id == ref.refid
}
- unless o
- raise EncodingStyleError.new("Unresolved reference: #{ ref.refid }.")
- end
if o.is_a?(SOAPReference)
- true
- else
+ true # link of link.
+ elsif o
ref.__setobj__(o)
false
+ elsif o = ref.rootnode.external_content[ref.refid]
+ ref.__setobj__(o)
+ false
+ else
+ raise EncodingStyleError.new("Unresolved reference: #{ ref.refid }.")
end
}
count -= 1