hooklift / gowsdl

WSDL2Go code generation as well as its SOAP proxy
Mozilla Public License 2.0
1.16k stars 392 forks source link

xsd:group references not being generated #177

Open 7robertodantas opened 4 years ago

7robertodantas commented 4 years ago

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?

philous commented 2 years ago

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

hadrienk commented 1 year ago

Groups are not implemented unfortunately.