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

WSDL attribute “nillable” generate twice #199

Closed
ntlei opened this issue Feb 18, 2019 · 2 comments
Closed

WSDL attribute “nillable” generate twice #199

ntlei opened this issue Feb 18, 2019 · 2 comments

Comments

@ntlei
Copy link

ntlei commented Feb 18, 2019

Hi,
i find there is an error when input parameter include an array type in an action,
I use XmlSerializer.
For example:

public partial class HeaderType  {

       [System.Xml.Serialization.XmlAnyElementAttribute()]
       public System.Xml.XmlElement[] Any   {   get;  set;       }
        .......
}

the generated WSDL :

     <xs:complexType name="ArrayOfXmlElement">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" nillable="true" name="XmlElement" nillable="true" type="tns:ArrayOfObject"/>
        </xs:sequence>
      </xs:complexType>

there are two "nillable" attribute generated and cause an error
I checked the source and comment line 470 out in MetaBodyWriter.cs, it works.
Maybe you could fix it.

			if (isArray)
				{
					writer.WriteAttributeString("maxOccurs", "unbounded");

					\\writer.WriteAttributeString("nillable", "true");
				}

Thanks your great job!

@kotovaleksandr
Copy link
Member

Hi, @ntlei! Please, check on my fork https://github.com/kotovaleksandr/SoapCore if this fix solve your problem i can merge to main branch and publish new version of nuget package.

@ntlei
Copy link
Author

ntlei commented Feb 28, 2019

Hi, @ntlei! Please, check on my fork https://github.com/kotovaleksandr/SoapCore if this fix solve your problem i can merge to main branch and publish new version of nuget package.

@kotovaleksandr ,i checked your modification,and test with my project,it works, 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

No branches or pull requests

2 participants