diff --git a/VERSION.yml b/VERSION.yml index 03ac302..7affc69 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,4 +1,4 @@ --- :minor: 4 -:patch: 0 +:patch: 1 :major: 0 diff --git a/handsoap.gemspec b/handsoap.gemspec index a76024e..f90f514 100644 --- a/handsoap.gemspec +++ b/handsoap.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = %q{handsoap} - s.version = "0.4.0" + s.version = "0.4.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Troels Knak-Nielsen"] @@ -25,17 +25,16 @@ Gem::Specification.new do |s| "lib/handsoap/xml_mason.rb", "lib/handsoap/xml_query_front.rb" ] - s.has_rdoc = true s.homepage = %q{http://github.com/troelskn/handsoap} s.rdoc_options = ["--charset=UTF-8"] s.require_paths = ["lib"] s.requirements = ["You need to install either \"curb\" or \"httpclient\", using one of:\n gem install curb\n gem install httpclient", "It is recommended that you install either \"nokogiri\" or \"libxml-ruby\""] - s.rubygems_version = %q{1.3.1} + s.rubygems_version = %q{1.3.4} s.summary = %q{Handsoap is a library for creating SOAP clients in Ruby} if s.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 2 + s.specification_version = 3 if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then else diff --git a/lib/handsoap/service.rb b/lib/handsoap/service.rb index 81eafc5..78a7990 100644 --- a/lib/handsoap/service.rb +++ b/lib/handsoap/service.rb @@ -57,30 +57,30 @@ class Service def self.logger=(io) @@logger = io end - # Sets the endpoint for the service. - # Arguments: - # :uri => endpoint uri of the service. Required. - # :version => 1 | 2 - # :envelope_namespace => Namespace of SOAP-envelope - # :request_content_type => Content-Type of HTTP request. - # You must supply either :version or both :envelope_namspace and :request_content_type. - # :version is simply a shortcut for default values. + # Sets the endpoint for the service. + # Arguments: + # :uri => endpoint uri of the service. Required. + # :version => 1 | 2 + # :envelope_namespace => Namespace of SOAP-envelope + # :request_content_type => Content-Type of HTTP request. + # You must supply either :version or both :envelope_namspace and :request_content_type. + # :version is simply a shortcut for default values. def self.endpoint(args = {}) @uri = args[:uri] || raise("Missing option :uri") - if args[:version] + if args[:version] soap_namespace = { 1 => 'http://schemas.xmlsoap.org/soap/envelope/', 2 => 'http://www.w3.org/2003/05/soap-envelope' } - raise("Unknown protocol version '#{@protocol_version.inspect}'") if soap_namespace[args[:version]].nil? - @envelope_namespace = soap_namespace[args[:version]] - @request_content_type = args[:version] == 1 ? "text/xml" : "application/soap+xml" - end - @envelope_namespace = args[:envelope_namespace] unless args[:envelope_namespace].nil? - @request_content_type = args[:request_content_type] unless args[:request_content_type].nil? - if @envelope_namespace.nil? || @request_content_type.nil? - raise("Missing option :envelope_namespace, :request_content_type or :version") - end + raise("Unknown protocol version '#{@protocol_version.inspect}'") if soap_namespace[args[:version]].nil? + @envelope_namespace = soap_namespace[args[:version]] + @request_content_type = args[:version] == 1 ? "text/xml" : "application/soap+xml" + end + @envelope_namespace = args[:envelope_namespace] unless args[:envelope_namespace].nil? + @request_content_type = args[:request_content_type] unless args[:request_content_type].nil? + if @envelope_namespace.nil? || @request_content_type.nil? + raise("Missing option :envelope_namespace, :request_content_type or :version") + end end def self.envelope_namespace - @envelope_namespace + @envelope_namespace end def self.request_content_type @request_content_type @@ -316,7 +316,7 @@ def self.pretty_format_envelope(xml_string) begin doc = Handsoap::XmlQueryFront.parse_string(xml_string, Handsoap.xml_query_driver) rescue Exception => ex - return "Formatting failed: " + ex.to_s + return xml_string end return doc.to_xml # return "\n\e[1;33m" + doc.to_s + "\e[0m" @@ -420,7 +420,7 @@ def self.parse_multipart(boundary, content_io, content_length = nil) end -# Legacy/CS code here. This shouldn't be used in new applications. +# Legacy/BC code here. This shouldn't be used in new applications. module Handsoap class Service # Registers a simple method mapping without any arguments and no parsing of response.