Skip to content

Svcutil not generating all classes #3392

@m-pedersen

Description

@m-pedersen

I have been provided with an .wsdl file and a set .xsd files to create proxy classes for interacting with an external service. Using svcutil i do not get all the classes corresponding to the defined types in the .xsd files. For example some xml on the form:

<xs:complexType name="ValidationReply" abstract="false">
  <xs:complexContent>
    <xs:extension base="common:Reply">
      <xs:sequence>
        <xs:element name="data" type="ns:ValidationReplyData" minOccurs="0" maxOccurs="1"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
<xs:complexType name="ValidationReplyData" abstract="false">
  <xs:sequence>
    <xs:element name="errors" type="ns:Error" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>

Generates the code:

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.4")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="Namespace")]
public partial class ValidationReply: Reply
{

    private Error[] dataField;

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
    [System.Xml.Serialization.XmlArrayItemAttribute("errors", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
    public Error[] data
    {
        get
        {
            return this.dataField;
        }
        set
        {
            this.dataField = value;
        }
    }
}

But it should generate:

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.4")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="Namespace")]
public partial class ValidationReply: Reply
{

    private ValidationReplyData dataField;

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
    public ValidationReplyData data
    {
        get
        {
            return this.dataField;
        }
        set
        {
            this.dataField = value;
        }
    }
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.4")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="Namespace")]
public partial class ValidationReplyData
{

    private Error[] errorsField;

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
    public Error[] errors
    {
        get
        {
            return this.errorsField;
        }
        set
        {
            this.errorsField= value;
        }
    }
}

Other wise the xml returned by the external service will not deserialize correctly (ValidationReply.data always null).

Are others experiencing this issue?

Metadata

Metadata

Assignees

Labels

toolingAn issues related to any tool shipped from this repo.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions