Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1837

Show
Ignore:
Timestamp:
06/07/07 22:00:28 (1 year ago)
Author:
nahi
Message:
  • avoid conflict with ActiveSupport?'s Array#to_xml. renamed to_xml -> to_xmlpart. closes #357.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/baseData.rb

    r1836 r1837  
    738738  end 
    739739 
    740   def to_xml 
    741     @obj.to_xml 
     740  def to_xmlpart 
     741    @obj.to_xmlpart 
    742742  end 
    743743end 
     
    749749  end 
    750750 
    751   def to_xml 
     751  def to_xmlpart 
    752752    @ele.to_s 
    753753  end 
  • trunk/lib/soap/element.rb

    r1833 r1837  
    103103    @encodingstyle = nil 
    104104    if data 
    105       if data.respond_to?(:to_xml
     105      if data.respond_to?(:to_xmlpart
    106106        data = SOAP::SOAPRawData.new(data) 
    107107      elsif defined?(::REXML) and data.is_a?(::REXML::Element) 
  • trunk/lib/soap/generator.rb

    r1824 r1837  
    1111require 'soap/baseData' 
    1212require 'soap/encodingstyle/handler' 
     13require 'xsd/codegen/gensupport' 
    1314 
    1415 
     
    2122class SOAPGenerator 
    2223  include SOAP 
     24  include XSD::CodeGen::GenSupport 
    2325 
    2426  class FormatEncodeError < Error; end 
     
    6971 
    7072  def encode_data(ns, obj, parent) 
    71     if obj.respond_to?(:to_xml) 
    72       @buf << "\n#{obj.to_xml}" 
     73    if obj.respond_to?(:to_xmlpart) 
     74      formatted = trim_eol(obj.to_xmlpart) 
     75      formatted = trim_indent(formatted) 
     76      formatted = formatted.gsub(/^/, @indent).sub(/\n+\z/, '') 
     77      @buf << "\n#{formatted}" 
    7378      return 
    7479    elsif obj.is_a?(SOAPEnvelopeElement) 
  • trunk/lib/soap/mapping/mapping.rb

    r1832 r1837  
    121121 
    122122  def self._obj2soap(obj, registry, type = nil) 
    123     if obj.respond_to?(:to_xml
     123    if obj.respond_to?(:to_xmlpart
    124124      SOAPRawData.new(obj) 
    125125    elsif defined?(::REXML) and obj.is_a?(::REXML::Element) 
  • trunk/test/soap/asp.net/test_aspdotnet.rb

    r1794 r1837  
    7676    ele = REXML::Document.new(xml) 
    7777    assert_equal("Hello Mike", @client.sayHello(ele)) 
    78     def xml.to_xml; to_s; end 
     78    def xml.to_xmlpart; to_s; end 
    7979    assert_equal("Hello Mike", @client.sayHello(xml)) 
    8080  end