aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib/action_web_service
diff options
context:
space:
mode:
Diffstat (limited to 'actionwebservice/lib/action_web_service')
-rw-r--r--actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb12
-rw-r--r--actionwebservice/lib/action_web_service/protocol/soap_protocol.rb2
2 files changed, 11 insertions, 3 deletions
diff --git a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
index 38fc7e4410..bce3f4e944 100644
--- a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
+++ b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
@@ -167,8 +167,16 @@ module ActionWebService # :nodoc:
private
def base_uri
- host = @request ? (@request.env['HTTP_HOST'] || @request.env['SERVER_NAME']) : 'localhost'
- 'http://%s/%s/' % [host, controller_name]
+ if @request
+ host = @request.env['HTTP_HOST'] || @request.env['SERVER_NAME']
+ relative_url_root = @request.relative_url_root
+ scheme = @request.ssl? ? 'https' : 'http'
+ else
+ host = 'localhost'
+ relative_url_root = ""
+ scheme = 'http'
+ end
+ '%s://%s%s/%s/' % [scheme, host, relative_url_root, controller_name]
end
def to_wsdl
diff --git a/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb b/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
index fde992bf9a..b3f1be2ae4 100644
--- a/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
+++ b/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
@@ -93,7 +93,7 @@ module ActionWebService # :nodoc:
end
end
envelope = create_soap_envelope(response)
- Response.new(SOAP::Processor.marshal(envelope), 'text/xml', return_value)
+ Response.new(SOAP::Processor.marshal(envelope), 'text/xml; charset=utf-8', return_value)
end
def protocol_client(api, protocol_name, endpoint_uri, options={})