Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element type renaming #24

Open
notzippy opened this issue Mar 18, 2015 · 5 comments
Open

Element type renaming #24

notzippy opened this issue Mar 18, 2015 · 5 comments

Comments

@notzippy
Copy link
Contributor

I will start off with I am no wsdl expert - given the following wsdl fragment

<xsd:element name="ValidateCityPostalCodeZipRequestContainer" nillable="true" type="tns:ValidateCityPostalCodeZipRequestContainer"/>
<xsd:complexType name="ArrayOfShortAddress">
  <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="unbounded" name="ShortAddress" nillable="true" type="tns:ShortAddress"/>
  </xsd:sequence>
  </xsd:complexType>
    <xsd:element name="ArrayOfShortAddress" nillable="true" type="tns:ArrayOfShortAddress"/>
    <xsd:element name="ValidateCityPostalCodeZipRequest" nillable="true" type="tns:ValidateCityPostalCodeZipRequestContainer"/>

The proper output response is

    <ns1:ValidateCityPostalCodeZipRequest>
        <ns1:Addresses>
            <ns1:ShortAddress>
    ...
            </ns1:ShortAddress>
        </ns1:Addresses>
    </ns1:ValidateCityPostalCodeZipRequest>

What is being generated is

    <AA:ValidateCityPostalCodeZipRequestContainer>
        <AA:Addresses>
            <AA:ShortAddress>
    ...
            </AA:ShortAddress>
        </AA:Addresses>
    </AA:ValidateCityPostalCodeZipRequestContainer>

Notice the ValidateCityPostalCodeZipRequestContainer vs ValidateCityPostalCodeZipRequest The later is correct, I assume this is described in <xsd:element name="ValidateCityPostalCodeZipRequest" nillable="true" type="tns:ValidateCityPostalCodeZipRequestContainer"/>

The structure is good, just the xml.Name should be changed
XMLName xml.Namexml:"http://purolator.com/pws/service/v1 ValidateCityPostalCodeZipRequest"``

@c4milo
Copy link
Member

c4milo commented Mar 18, 2015

@notzippy the generator is assigning whatever is being declared in the WSDL. If the type is named ValidateCityPostalCodeZipRequestContainer in the WSDL, it will use that.

@c4milo
Copy link
Member

c4milo commented Mar 18, 2015

maybe we should use whatever is coming in the name attribute when it is set?

@c4milo
Copy link
Member

c4milo commented Mar 18, 2015

ah nevermind, it has the same name as the type. Yeah, it is just generating whatever the WSDL has.

@c4milo
Copy link
Member

c4milo commented Aug 5, 2015

@notzippy gowsdl does not yet support namespaces, mainly due to Go's lack of proper support in the standard library.

@notzippy
Copy link
Contributor Author

notzippy commented Aug 5, 2015

This isnt a namespace issue, it is the ValidateCityPostalCodeZipRequestContainer vs ValidateCityPostalCodeZipRequest that is the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants