web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

XsdDataContractExporter creates extra complex field as compare to SVCUtil.exe

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am creating XSD by using XsdDataContractExporter from DLL, but i found that it creates one extra complex element in schema as compare to Svcutil.exe as shown in below image.

Schema-created-by-from-DLL-XsdDataContractExporter.png

I used Svcutil.exe to create XSD from DLL, which gave correct XSD as shown in below image.

Schema-created-by-Svcutil-from-DLL.PNG

I am giving you code snippet from DLL as below.


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.33440")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria")]
[System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria")]
public partial class CriteriaElement
{
     private string dataSourceNameField;
     private string fieldNameField;
     private Operator operatorField;
     private string value1Field;
     private string value2Field;

     /// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
[System.Runtime.Serialization.DataMemberAttribute(Order=0)]
public string DataSourceName
{
get { return this.dataSourceNameField;}
set {this.dataSourceNameField = value;}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=1)]
[System.Runtime.Serialization.DataMemberAttribute(Order=1)]
public string FieldName
{
get { return this.fieldNameField; }
set { this.fieldNameField = value; }
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
[System.Runtime.Serialization.DataMemberAttribute(Order=2)]
public Operator Operator
{
get { return this.operatorField; }
set { this.operatorField = value;}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=3)]
[System.Runtime.Serialization.DataMemberAttribute(Order=3)]
public string Value1
{
get { return this.value1Field; }
set { this.value1Field = value; }
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=4)]
[System.Runtime.Serialization.DataMemberAttribute(Order=4)]
public string Value2
{
get { return this.value2Field; }
set { this.value2Field = value;}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.33440")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria")]
[System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria")]
public enum Operator
{
/// <remarks/>
[System.Runtime.Serialization.EnumMemberAttribute()]
Equal,

/// <remarks/>
[System.Runtime.Serialization.EnumMemberAttribute()]
NotEqual,
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.33440")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria")]
[System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.microsoft.com/dynamics/2006/02/documents/QueryCriteria")]
public partial class QueryCriteria
{
private CriteriaElement[] criteriaElementField;

   /// <remarks/>
   [System.Xml.Serialization.XmlElementAttribute("CriteriaElement", Order=0)]
   [System.Runtime.Serialization.DataMemberAttribute(Name="CriteriaElement",Order=0)]
   public CriteriaElement[] CriteriaElement
       {
         get {   return this.criteriaElementField; }
         set {   this.criteriaElementField = value;}
       }
}

Can anyone know, why extra complex element is created by XsdDataContractExporter?

Thanks,

Amol Shinde.

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans