mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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.
* lib/soap/mapping/factory.rb: deleted unused methods.
* lib/soap/mapping/rubytypeFactory.rb: do no ignore case while xsi:type
string <-> Ruby class name matching.
* test/wsdl/soap/{soapbodyparts.wsdl,test_soapbodyparts.wsdl}: new
files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2a2fa6fd8b
commit
7200644b54
5 changed files with 26 additions and 20 deletions
|
|
@ -87,14 +87,6 @@ class Factory
|
|||
Thread.current[:SOAPMarshalDataKey][node.id] = obj
|
||||
end
|
||||
|
||||
def name2typename(name)
|
||||
capitalize(name)
|
||||
end
|
||||
|
||||
def capitalize(target)
|
||||
target.gsub(/^([a-z])/) { $1.tr!('[a-z]', '[A-Z]') }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def setiv2ary(obj, node, map)
|
||||
|
|
|
|||
|
|
@ -343,9 +343,6 @@ private
|
|||
when TYPE_STRUCT
|
||||
typestr = Mapping.elename2name(node['type'].data)
|
||||
klass = Mapping.class_from_name(typestr)
|
||||
if klass.nil?
|
||||
klass = Mapping.class_from_name(name2typename(typestr))
|
||||
end
|
||||
if klass.nil?
|
||||
return false
|
||||
end
|
||||
|
|
@ -400,9 +397,6 @@ private
|
|||
end
|
||||
typestr = Mapping.elename2name(node.type.name)
|
||||
klass = Mapping.class_from_name(typestr)
|
||||
if klass.nil?
|
||||
klass = Mapping.class_from_name(name2typename(typestr))
|
||||
end
|
||||
if klass.nil?
|
||||
return nil
|
||||
end
|
||||
|
|
|
|||
|
|
@ -205,11 +205,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)
|
||||
|
||||
|
|
@ -261,6 +257,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
|
||||
|
|
|
|||
|
|
@ -104,7 +104,10 @@ private
|
|||
op_name.namespace = soapbody.namespace
|
||||
end
|
||||
if soapbody.parts
|
||||
raise NotImplementedError.new("soap:body parts")
|
||||
target = soapbody.parts.split(/\s+/)
|
||||
bodyparts = name_info.parts.find_all { |part|
|
||||
target.include?(part.name)
|
||||
}
|
||||
else
|
||||
bodyparts = name_info.parts
|
||||
end
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ class Schema < Info
|
|||
o = ComplexType.new
|
||||
@complextypes << o
|
||||
o
|
||||
when SimpleTypeName
|
||||
STDERR.puts("Restriction of basetype with simpleType definition is ignored for now.")
|
||||
nil
|
||||
when ElementName
|
||||
o = Element.new
|
||||
@elements << o
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue