mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
add charset=utf-8 to SOAP response content type, and make base_uri
respect relative_url_root for the endpoint of SOAP messages (Shugo Maeda). if WSDL was retrieved over HTTPS, use HTTPS in the endpoint URLs as well. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
74c9fd2ba5
commit
896fea505b
3 changed files with 17 additions and 3 deletions
|
@ -1,5 +1,11 @@
|
|||
*SVN*
|
||||
|
||||
* Fix that generated WSDL was not using relative_url_root for base URI #1210 [Shugo Maeda]
|
||||
|
||||
* Use UTF-8 encoding for SOAP responses #1211 [Shugo Maeda]
|
||||
|
||||
* If the WSDL was retrieved over HTTPS, use HTTPS URLs in the WSDL too
|
||||
|
||||
* Fix that casting change in 0.7.0 would convert nil values to the default value for the type instead of leaving it as nil
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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={})
|
||||
|
|
Loading…
Reference in a new issue