hooklift/gowsdl

xsd:group references not being generated

7robertodantas opened this issue · 2 comments

Hi,

I have a wsdl that looks like this

<wsdl:definitions name='FOO' targetNamespace='http://foo.com/bar/'
                  xmlns:tns='http://foo.com/bar/'
                  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
                  xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
    <wsdl:types>
        <xsd:schema targetNamespace='http://foo.com/bar/'>
            <xsd:group name='FooGroup'>
                <xsd:sequence>
                    <xsd:element name='FooString' type='xsd:string'/>
                    <xsd:element name='BarString' type='xsd:string'/>
                </xsd:sequence>
            </xsd:group>
            <xsd:element name='FooElement'>
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:group ref='tns:FooGroup' />
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </wsdl:types>
</wsdl:definitions>

So I'd expect to generate a struct like the following

type FooElement struct {
	XMLName xml.Name `xml:"http://foo.com/bar/ FooElement"`
	FooString string `xml:"FooString,omitempty" json:"FooString,omitempty"`
	BarString string `xml:"BarString,omitempty" json:"BarString,omitempty"`
}

but it generates instead

// Code generated by gowsdl DO NOT EDIT.

package myservice

import (
	"encoding/xml"
	"time"
)

// against "unused imports"
var _ time.Time
var _ xml.Name

type AnyType struct {
	InnerXML string `xml:",innerxml"`
}

type AnyURI string

type NCName string

type FooElement struct {
	XMLName xml.Name `xml:"http://foo.com/bar/ FooElement"`
}

Is xsd:group supported?

hey, I have the same issue, did you manage to find a workaround?

Groups are not implemented unfortunately.