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

bugfix: complex type with a member of a complex type decorated per XmlElementAttribute with custom name breaks custom names of the members specified per XmlElementAttributes of the sub-complex type #983

Conversation

edgridin
Copy link
Contributor

Having a complex type (please see ComplexComplexType in the suppled unit test CheckComplexComplexTypeWithCustomXmlNamesWsdl) with a member being itself a complex type (ComplexType), which is configured to have a custom name 'complex' specified by XmlElement, on WSDL generation with XmlSerializer overwrites the custom names and property names, specified by ComplexType, by the name 'complex', producing following definition

<xsd:complexType name="ComplexType">
xsd:sequence
<xsd:element minOccurs="1" maxOccurs="1" name="complex" type="xsd:int" />
<xsd:element minOccurs="0" maxOccurs="1" name="complex" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="complex" type="xsd:base64Binary" />
<xsd:element minOccurs="1" maxOccurs="1" name="complex" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>

correct would be (and is achieved by this fix)

<xsd:complexType name="ComplexType">
xsd:sequence
<xsd:element minOccurs="1" maxOccurs="1" name="IntProperty" type="xsd:int" />
<xsd:element minOccurs="0" maxOccurs="1" name="stringprop" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="mybytes" type="xsd:base64Binary" />
<xsd:element minOccurs="1" maxOccurs="1" name="MyGuid" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>

…lElementAttribute with custom name breaks custom names of the members specified per XmlElementAttributes of the sub-complex type
@andersjonsson
Copy link
Collaborator

Could you please update your branch from the latest "develop"? Needed to fix some things to make CI work

@andersjonsson andersjonsson merged commit 6dfd59e into DigDes:develop Jan 2, 2024
3 checks passed
@andersjonsson
Copy link
Collaborator

Merged!
Thank you for this fix

@edgridin
Copy link
Contributor Author

edgridin commented Jan 2, 2024

@andersjonsson , thank you for accepting the fix and for the support of SoapCore, it helps me a lot in my current project

@edgridin
Copy link
Contributor Author

edgridin commented Jan 2, 2024

@andersjonsson , maybe a small question - do you already know, if you'll publish the bugfix on Nuget? If not, when would you publish the next release of the package?

@andersjonsson
Copy link
Collaborator

Tried to publish but the api key needs to be updated. I don't have access to that but hopefully it can be sorted quickly

@andersjonsson
Copy link
Collaborator

Fixed. New version is available on nuget now
https://www.nuget.org/packages/soapcore

@edgridin
Copy link
Contributor Author

edgridin commented Jan 3, 2024

thank you!

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

Successfully merging this pull request may close these issues.

2 participants