-
Notifications
You must be signed in to change notification settings - Fork 380
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
XmlArray and XmlArrayItem are not honored in method parameters #1106
Comments
A first issue seems to be located when you test if the argument is an array or not here : SoapCore/src/SoapCore/Serializer/SerializerHelper.cs Lines 46 to 58 in 1187499
Important note : |
In my opinion the first change would be : if (!parameterType.IsArray && !parameterType.GetInterfaces().Contains(typeof(IList)))
{
// case [XmlElement("parameter")] int parameter
// case [XmlArray("parameter")] int[] parameter
return DeserializeObject(xmlReader, parameterType, parameterName, parameterNs);
}
else
{
// case int[] or List<int> parameter
// case [XmlElement("parameter")] int[] or List<int> parameter
// case [XmlArray("parameter"), XmlArrayItem(ElementName = "item")] int[] or List<int> parameter
return DeserializeArrayXmlSerializer(xmlReader, parameterType, parameterName, parameterNs, customAttributeProvider);
} But it the WSDL generation error will remain. |
WSDL definition of the parameter name seems to be here ? SoapCore/src/SoapCore/Meta/MetaBodyWriter.cs Lines 282 to 297 in 1187499
Maybe you should add a part where you get the [XmlArray] attribute if it's an array or a list ?FYI : (parameterType.IsArray || parameterType.GetInterfaces().Contains(typeof(IList)))
And maybe add the check for the List here too ? SoapCore/src/SoapCore/Meta/MetaBodyWriter.cs Lines 816 to 825 in 1187499
|
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Hello,
I have an issue with
[XmlArray]
and[XmlArrayItem]
attributes that are not honored only when used in method parameters.These works well when used in an serialized object but not when used on a parameter.
Version used : SoapCore 1.1.0.51 in a .NET 8 project.
To summary, this code :
result in WSDL :
instead of :
The text was updated successfully, but these errors were encountered: