aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test/dispatcher_action_controller_soap_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionwebservice/test/dispatcher_action_controller_soap_test.rb')
-rw-r--r--actionwebservice/test/dispatcher_action_controller_soap_test.rb25
1 files changed, 16 insertions, 9 deletions
diff --git a/actionwebservice/test/dispatcher_action_controller_soap_test.rb b/actionwebservice/test/dispatcher_action_controller_soap_test.rb
index 6e332828f2..16a20ea73e 100644
--- a/actionwebservice/test/dispatcher_action_controller_soap_test.rb
+++ b/actionwebservice/test/dispatcher_action_controller_soap_test.rb
@@ -67,16 +67,23 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
assert_equal(["bloggerCat1", "bloggerCat2"], blogger_cats)
end
- protected
- def update_request(ap_request)
- ap_request.env.update('HTTP_CONTENT_TYPE' => 'text/xml; charset=us-ascii')
- end
-
- def check_response(ap_response)
- assert_equal 'text/xml; charset=us-ascii', ap_response.headers['Content-Type']
- assert_match /xml.*?encoding="us-ascii"/, ap_response.body
- end
+ def test_utf8
+ @direct_controller.web_service_exception_reporting = true
+ $KCODE = 'u'
+ assert_equal(Utf8String, do_method_call(@direct_controller, 'TestUtf8'))
+
+ # If $KCODE is not set to UTF-8, any strings with non-ASCII UTF-8 data
+ # will be sent back as base64 by SOAP4R. By the time we get it here though,
+ # it will be decoded back into a string. So lets read the base64 value
+ # from the message body directly.
+ $KCODE = 'NONE'
+ do_method_call(@direct_controller, 'TestUtf8')
+ retval = SOAP::Processor.unmarshal(@response_body).body.response
+ assert retval.is_a?(SOAP::SOAPBase64)
+ assert_equal "T25lIFdvcmxkIENhZsOp", retval.data.to_s
+ end
+ protected
def exception_message(soap_fault_exception)
soap_fault_exception.detail.cause.message
end