summaryrefslogtreecommitdiff
path: root/lib/wsdl/soap/complexType.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wsdl/soap/complexType.rb')
-rw-r--r--lib/wsdl/soap/complexType.rb31
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/wsdl/soap/complexType.rb b/lib/wsdl/soap/complexType.rb
index bba50fd153..b2e13d0564 100644
--- a/lib/wsdl/soap/complexType.rb
+++ b/lib/wsdl/soap/complexType.rb
@@ -106,18 +106,43 @@ class ComplexType < Info
end
end
if check_array_content(complexcontent.content)
- return complexcontent.content.elements[0].type
+ return element_simpletype(complexcontent.content.elements[0])
end
elsif check_array_content(content)
- return content.elements[0].type
+ return element_simpletype(content.elements[0])
end
raise RuntimeError.new("Assert: Unknown array definition.")
end
+ def find_aryelement
+ unless compoundtype == :TYPE_ARRAY
+ raise RuntimeError.new("Assert: not for array")
+ end
+ if complexcontent
+ if check_array_content(complexcontent.content)
+ return complexcontent.content.elements[0]
+ end
+ elsif check_array_content(content)
+ return content.elements[0]
+ end
+ nil # use default item name
+ end
+
private
+ def element_simpletype(element)
+ if element.type
+ element.type
+ elsif element.local_simpletype
+ element.local_simpletype.base
+ else
+ nil
+ end
+ end
+
def check_array_content(content)
- content.elements.size == 1 and content.elements[0].maxoccurs != '1'
+ content and content.elements.size == 1 and
+ content.elements[0].maxoccurs != '1'
end
def content_arytype