aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib/action_web_service/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'actionwebservice/lib/action_web_service/protocol')
-rw-r--r--actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb15
-rw-r--r--actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb4
2 files changed, 15 insertions, 4 deletions
diff --git a/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb b/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb
index b36e029669..fa917ad4a5 100644
--- a/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb
+++ b/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb
@@ -32,7 +32,9 @@ module ActionWebService
end
def ruby_to_soap(obj)
- SOAP::Mapping.obj2soap(obj, @registry)
+ soap = SOAP::Mapping.obj2soap(obj, @registry)
+ soap.elename = XSD::QName.new if SOAP::Version >= "1.5.5" && soap.elename == XSD::QName::EMPTY
+ soap
end
def register_type(type)
@@ -63,12 +65,21 @@ module ActionWebService
end
@type2binding[type] = array_binding ? array_binding : type_binding
+
+ if type.structured?
+ type.each_member do |m_name, m_type|
+ register_type(m_type)
+ end
+ end
+
@type2binding[type]
end
alias :lookup_type :register_type
def annotate_arrays(binding, value)
- if binding.type.array?
+ if value.nil?
+ return
+ elsif binding.type.array?
mark_typed_array(value, binding.element_binding.qname)
if binding.element_binding.type.custom?
value.each do |element|
diff --git a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
index 53b67ced4c..64992e7754 100644
--- a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
+++ b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
@@ -50,10 +50,10 @@ module ActionWebService # :nodoc:
end
def encode_response(method_name, return_value, return_type, protocol_options={})
- return_value = true if return_value.nil?
- if return_type
+ if return_value && return_type
return_value = value_to_xmlrpc_wire_format(return_value, return_type)
end
+ return_value = false if return_value.nil?
raw_response = XMLRPC::Marshal.dump_response(return_value)
Response.new(raw_response, 'text/xml', return_value)
end