summaryrefslogtreecommitdiffstats
path: root/lib/soap/wsdlDriver.rb
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-18 11:10:18 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-18 11:10:18 +0000
commitc92043183c565c3e7c5f15aa7c6bc53b07e375f1 (patch)
tree80f8352e7612adc1ada88350438d28ff93b60e31 /lib/soap/wsdlDriver.rb
parente3e4d08f7fb077103dd74825d069b3eb0d08d6b0 (diff)
downloadruby-c92043183c565c3e7c5f15aa7c6bc53b07e375f1.tar.gz
ruby-c92043183c565c3e7c5f15aa7c6bc53b07e375f1.tar.xz
ruby-c92043183c565c3e7c5f15aa7c6bc53b07e375f1.zip
* lib/soap/wsdlDriver.rb, lib/wsdl/soap/operation.rb: add support of
"parts" attribute of soap:body element in WSDL. * lib/wsdl/xmlSchema/schema.rb: friendly warning message for simpleType element which is not supported for now. * test/wsdl/soap/{soapbodyparts.wsdl,test_soapbodyparts.wsdl}: new files. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/soap/wsdlDriver.rb')
-rw-r--r--lib/soap/wsdlDriver.rb24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/soap/wsdlDriver.rb b/lib/soap/wsdlDriver.rb
index cd93e3dee..4b36bd08b 100644
--- a/lib/soap/wsdlDriver.rb
+++ b/lib/soap/wsdlDriver.rb
@@ -206,11 +206,7 @@ class WSDLDriver
log(DEBUG) { "call: parameters '#{ params.inspect }'." }
op_info = @operations[method_name]
- parts_names = op_info.bodyparts.collect { |part| part.name }
- obj = create_method_obj(parts_names, params)
- method = Mapping.obj2soap(obj, @wsdl_mapping_registry, op_info.optype_name)
- method.elename = op_info.op_name
- method.type = XSD::QName.new # Request should not be typed.
+ method = create_method_struct(op_info, params)
req_header = nil
req_body = SOAPBody.new(method)
req_env = SOAPEnvelope.new(req_header, req_body)
@@ -264,6 +260,24 @@ class WSDLDriver
private
+ def create_method_struct(op_info, params)
+ parts_names = op_info.bodyparts.collect { |part| part.name }
+ obj = create_method_obj(parts_names, params)
+ method = Mapping.obj2soap(obj, @wsdl_mapping_registry, op_info.optype_name)
+ if method.members.size != parts_names.size
+ new_method = SOAPStruct.new
+ method.each do |key, value|
+ if parts_names.include?(key)
+ new_method.add(key, value)
+ end
+ end
+ method = new_method
+ end
+ method.elename = op_info.op_name
+ method.type = XSD::QName.new # Request should not be typed.
+ method
+ end
+
def create_method_obj(names, params)
o = Object.new
for idx in 0 ... params.length