Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:troelskn/handsoap
Browse files Browse the repository at this point in the history
  • Loading branch information
troelskn committed Aug 3, 2009
2 parents 1ee18b9 + 0362dcc commit 25ef0ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion VERSION.yml
@@ -1,4 +1,4 @@
---
:minor: 4
:patch: 0
:patch: 1
:major: 0
7 changes: 3 additions & 4 deletions handsoap.gemspec
Expand Up @@ -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"]
Expand All @@ -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
Expand Down
42 changes: 21 additions & 21 deletions lib/handsoap/service.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 25ef0ae

Please sign in to comment.