Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/wsdl/soap/classDefCreator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ def create_structdef(mpath, qname, typedef, qualified = false)
parentmodule = mapped_class_name(qname, mpath)
init_lines, init_params =
parse_elements(c, typedef.elements, qname.namespace, parentmodule)
if typedef.content && (WSDL::XMLSchema::Group === typedef.content)
g_init_lines, g_init_params =
parse_elements(c, typedef.content.refelement.elements, qname.namespace, parentmodule)
init_lines = (g_init_lines + init_lines)
init_params = (g_init_params + init_params)
end
unless typedef.attributes.empty?
define_attribute(c, typedef.attributes)
init_lines << "@__xmlattr = {}"
Expand Down Expand Up @@ -337,6 +343,9 @@ def parse_elements(c, elements, base_namespace, mpath, as_array = false)
init_lines.concat(child_init_lines)
init_params.concat(child_init_params)
when WSDL::XMLSchema::Group
if element.ref && element.content.nil?
element.content = element.refelement
end
if element.content.nil?
warn("no group definition found: #{element}")
next
Expand Down
5 changes: 5 additions & 0 deletions lib/wsdl/soap/mappingRegistryCreatorSupport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def dump_complex_typemap(mpath, qname, typedef, as_element, opt)
parentmodule = var[:class]
parsed_element =
parse_elements(typedef.elements, qname.namespace, parentmodule, opt)
if typedef.content && (WSDL::XMLSchema::Group === typedef.content) && typedef.elements.empty?
g_parsed_element =
parse_elements(typedef.content.refelement.elements, qname.namespace, parentmodule, opt)
parsed_element = (g_parsed_element + parsed_element)
end
if typedef.choice?
parsed_element.unshift(:choice)
end
Expand Down
5 changes: 3 additions & 2 deletions lib/wsdl/xmlSchema/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

require 'wsdl/info'
require 'wsdl/xmlSchema/ref'
require 'wsdl/xmlSchema/complexType'


module WSDL
module XMLSchema


class Group < Info
class Group < ComplexType
include Ref

attr_writer :name # required
Expand Down Expand Up @@ -89,7 +90,7 @@ def parse_attr(attr, value)
end
end

private
#private

def refelement
@refelement ||= (@ref ? root.collect_modelgroups[@ref] : nil)
Expand Down