Skip to content

Commit

Permalink
String and Byte[] are special-cases since they are built in types tha…
Browse files Browse the repository at this point in the history
…t C# sees as enumerable. They should not be unbounded in the wsdl since that would cause clients to generate byte[] as byte[][] etc.

fixes #959
  • Loading branch information
andersjonsson committed Sep 13, 2023
1 parent dfa51c3 commit 5026da3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/SoapCore.Tests/Wsdl/Services/ComplexType.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace SoapCore.Tests.Wsdl.Services
{
public class ComplexType
{
public int IntProperty { get; set; }
[XmlElement(ElementName = "stringprop")]
public string StringProperty { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/SoapCore/Meta/MetaBodyWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ private void AddSchemaType(XmlDictionaryWriter writer, TypeToBuild toBuild, stri
{
// skip occurence
}
else if (isArray)
else if (isArray && type.Name != "String" && type.Name != "Byte[]")
{
writer.WriteAttributeString("minOccurs", "0");
writer.WriteAttributeString("maxOccurs", "unbounded");
Expand Down

0 comments on commit 5026da3

Please sign in to comment.