I asked this question yeasterday but all the answers was not what i was looking for and i think it was much because i didnt fomulate the question that good so i will try again.
I have this xml doxument:
<?xml version="1.0" encoding="UTF-8"?>
<people type="array">
<person>
<author-id type="integer">5801</author-id>
<background></background>
<company-id type="integer">81881</company-id>
<created-at type="datetime">2011-08-10T08:39:45Z</created-at>
<first-name>Pr</first-name>
<group-id type="integer" nil="true"></group-id>
<id type="integer">8100134</id>
<last-name>"Cromwell" (Eriksson)</last-name>
<owner-id type="integer" nil="true"></owner-id>
<title>Ă€gare, grafiker</title>
<updated-at type="datetime">2011-08-16T08:17:43Z</updated-at>
<visible-to>Everyone</visible-to>
<company-name>Studio Total</company-name>
<linkedin-url nil="true"></linkedin-url>
<avatar_url></avatar_url>
<contact-data>
<instant-messengers type="array" />
<phone-numbers type="array">
<phone-number>
<id type="integer">70306123</id>
<location>Work</location>
<number>0703689909</number>
</phone-number>
</phone-numbers>
<email-addresses type="array">
<email-address>
<address>per#studiototal.se</address>
<id type="integer">39720318</id>
<location>Work</location>
</email-address>
</email-addresses>
<twitter-accounts type="array" />
<addresses type="array" />
<web-addresses type="array">
<web-address>
<id type="integer">70124</id>
<location>Work</location>
<url></url>
</web-address>
</web-addresses>
</contact-data>
</person>
<person>
<author-id type="integer">257</author-id>
<background></background>
<company-id type="integer">158696</company-id>
<created-at type="datetime">2013-02-18T12:49:37Z</created-at>
<first-name></first-name>
<group-id type="integer" nil="true"></group-id>
<id type="integer">1538730</id>
<last-name>"Malmer"</last-name>
<owner-id type="integer" nil="true"></owner-id>
<title>Projektledare Online listening</title>
<updated-at type="datetime">2013-02-18T12:49:37Z</updated-at>
<visible-to>Everyone</visible-to>
<company-name>Santa Maria</company-name>
<linkedin-url nil="true"></linkedin-url>
<avatar_url></avatar_url>
<contact-data>
<instant-messengers type="array" />
<phone-numbers type="array">
<phone-number>
<id type="integer">16649</id>
<location>Work</location>
<number>03-151</number>
</phone-number>
</phone-numbers>
<email-addresses type="array" />
<twitter-accounts type="array" />
<addresses type="array" />
<web-addresses type="array" />
</contact-data>
</person>
<person>
<author-id type="integer">8257</author-id>
<background></background>
<company-id type="integer">1518665</company-id>
<created-at type="datetime">2013-02-01T10:14:27Z</created-at>
<first-name>"Sorush"</first-name>
<group-id type="integer" nil="true"></group-id>
<id type="integer">151827</id>
<last-name></last-name>
<owner-id type="integer" nil="true"></owner-id>
<title></title>
<updated-at type="datetime">2013-02-01T10:16:29Z</updated-at>
<visible-to>Everyone</visible-to>
<company-name>Rancold</company-name>
<linkedin-url nil="true"></linkedin-url>
<avatar_url></avatar_url>
<contact-data>
<instant-messengers type="array" />
<phone-numbers type="array">
<phone-number>
<id type="integer">127275</id>
<location>Work</location>
<number></number>
</phone-number>
</phone-numbers>
<email-addresses type="array">
<email-address>
<address>sjkka#rakkncold.com</address>
<id type="integer">76736018</id>
<location>Work</location>
</email-address>
</email-addresses>
<twitter-accounts type="array" />
<addresses type="array" />
<web-addresses type="array">
<web-address>
<id type="integer">127976</id>
<location>Work</location>
<url>http://www.rancoltyd.com</url>
</web-address>
</web-addresses>
</contact-data>
</person>
<!--there are many more <person> elements-->
</people>
I want to Deserialize this to an .net list object(List<Person> People).
The Person Class:
public class Person
{
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class people
{
private peoplePerson[] personField;
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("person")]
public peoplePerson[] person
{
get
{
return this.personField;
}
set
{
this.personField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePerson
{
private peoplePersonAuthorid authoridField;
private string backgroundField;
private peoplePersonCompanyid companyidField;
private peoplePersonCreatedat createdatField;
private string firstnameField;
private peoplePersonGroupid groupidField;
private peoplePersonID idField;
private string lastnameField;
private peoplePersonOwnerid owneridField;
private string titleField;
private peoplePersonUpdatedat updatedatField;
private string visibletoField;
private string companynameField;
private peoplePersonLinkedinurl linkedinurlField;
private string avatar_urlField;
private peoplePersonContactdata contactdataField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("author-id")]
public peoplePersonAuthorid authorid
{
get
{
return this.authoridField;
}
set
{
this.authoridField = value;
}
}
/// <remarks/>
public string background
{
get
{
return this.backgroundField;
}
set
{
this.backgroundField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("company-id")]
public peoplePersonCompanyid companyid
{
get
{
return this.companyidField;
}
set
{
this.companyidField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("created-at")]
public peoplePersonCreatedat createdat
{
get
{
return this.createdatField;
}
set
{
this.createdatField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("first-name")]
public string firstname
{
get
{
return this.firstnameField;
}
set
{
this.firstnameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("group-id")]
public peoplePersonGroupid groupid
{
get
{
return this.groupidField;
}
set
{
this.groupidField = value;
}
}
/// <remarks/>
public peoplePersonID id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("last-name")]
public string lastname
{
get
{
return this.lastnameField;
}
set
{
this.lastnameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("owner-id")]
public peoplePersonOwnerid ownerid
{
get
{
return this.owneridField;
}
set
{
this.owneridField = value;
}
}
/// <remarks/>
public string title
{
get
{
return this.titleField;
}
set
{
this.titleField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("updated-at")]
public peoplePersonUpdatedat updatedat
{
get
{
return this.updatedatField;
}
set
{
this.updatedatField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("visible-to")]
public string visibleto
{
get
{
return this.visibletoField;
}
set
{
this.visibletoField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("company-name")]
public string companyname
{
get
{
return this.companynameField;
}
set
{
this.companynameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("linkedin-url")]
public peoplePersonLinkedinurl linkedinurl
{
get
{
return this.linkedinurlField;
}
set
{
this.linkedinurlField = value;
}
}
/// <remarks/>
public string avatar_url
{
get
{
return this.avatar_urlField;
}
set
{
this.avatar_urlField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("contact-data")]
public peoplePersonContactdata contactdata
{
get
{
return this.contactdataField;
}
set
{
this.contactdataField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonAuthorid
{
private string typeField;
private uint valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public uint Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonCompanyid
{
private string typeField;
private uint valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public uint Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonCreatedat
{
private string typeField;
private System.DateTime valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public System.DateTime Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonGroupid
{
private string typeField;
private bool nilField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool nil
{
get
{
return this.nilField;
}
set
{
this.nilField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonID
{
private string typeField;
private uint valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public uint Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonOwnerid
{
private string typeField;
private bool nilField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool nil
{
get
{
return this.nilField;
}
set
{
this.nilField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonUpdatedat
{
private string typeField;
private System.DateTime valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public System.DateTime Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonLinkedinurl
{
private bool nilField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool nil
{
get
{
return this.nilField;
}
set
{
this.nilField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonContactdata
{
private peoplePersonContactdataInstantmessengers instantmessengersField;
private peoplePersonContactdataPhonenumbers phonenumbersField;
private peoplePersonContactdataEmailaddresses emailaddressesField;
private peoplePersonContactdataTwitteraccounts twitteraccountsField;
private peoplePersonContactdataAddresses addressesField;
private peoplePersonContactdataWebaddresses webaddressesField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("instant-messengers")]
public peoplePersonContactdataInstantmessengers instantmessengers
{
get
{
return this.instantmessengersField;
}
set
{
this.instantmessengersField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("phone-numbers")]
public peoplePersonContactdataPhonenumbers phonenumbers
{
get
{
return this.phonenumbersField;
}
set
{
this.phonenumbersField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("email-addresses")]
public peoplePersonContactdataEmailaddresses emailaddresses
{
get
{
return this.emailaddressesField;
}
set
{
this.emailaddressesField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("twitter-accounts")]
public peoplePersonContactdataTwitteraccounts twitteraccounts
{
get
{
return this.twitteraccountsField;
}
set
{
this.twitteraccountsField = value;
}
}
/// <remarks/>
public peoplePersonContactdataAddresses addresses
{
get
{
return this.addressesField;
}
set
{
this.addressesField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("web-addresses")]
public peoplePersonContactdataWebaddresses webaddresses
{
get
{
return this.webaddressesField;
}
set
{
this.webaddressesField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonContactdataInstantmessengers
{
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class peoplePersonContactdataPhonenumbers
{
private peoplePersonContactdataPhonenumbersPhonenumber phonenumberField;
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("phone-number")]
public peoplePersonContactdataPhonenumbersPhonenumber phonenumber
{
get
{
return this.phonenumberField;
}
set
{
this.phonenumberField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
}
}
Error message:
And for those that cant swedish It says after additional information. "There is something wrong in the xml-document (2,2)"
And the "response" variable is the xml string
Related
I use the .NET SDK client (version 16.156.0-preview available on NuGet), but I search how I can get the test case steps that contain the shared steps.
The field parameterizedString seems to contain all the test steps, but when it contains the shared steps, the XML content is not clear.
Example of the code I use to get all test steps for a test case:
private void ReadTestCaseSteps(Microsoft.VisualStudio.Services.TestManagement.TestPlanning.WebApi.TestCase testCase)
{
foreach (var field in testCase.workItem.WorkItemFields.OfType<JObject>())
{
var stepsContent = ((JValue)((JContainer)field.First).First).Value.ToString();
using (TextReader stepsReader = new StringReader(stepsContent))
{
var serializer = new XmlSerializer(typeof(steps));
var steps = (steps)serializer.Deserialize(stepsReader);
}
}
}
The class "steps" is an XML description of this sample:
// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class steps
{
private stepsStep stepField;
private stepsCompref comprefField;
private byte idField;
private byte lastField;
/// <remarks/>
public stepsStep step
{
get
{
return this.stepField;
}
set
{
this.stepField = value;
}
}
/// <remarks/>
public stepsCompref compref
{
get
{
return this.comprefField;
}
set
{
this.comprefField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte last
{
get
{
return this.lastField;
}
set
{
this.lastField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsStep
{
private stepsStepParameterizedString[] parameterizedStringField;
private object descriptionField;
private byte idField;
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
public stepsStepParameterizedString[] parameterizedString
{
get
{
return this.parameterizedStringField;
}
set
{
this.parameterizedStringField = value;
}
}
/// <remarks/>
public object description
{
get
{
return this.descriptionField;
}
set
{
this.descriptionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsStepParameterizedString
{
private bool isformattedField;
private string valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool isformatted
{
get
{
return this.isformattedField;
}
set
{
this.isformattedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsCompref
{
private stepsComprefStep[] stepField;
private stepsComprefCompref comprefField;
private byte idField;
private ushort refField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("step")]
public stepsComprefStep[] step
{
get
{
return this.stepField;
}
set
{
this.stepField = value;
}
}
/// <remarks/>
public stepsComprefCompref compref
{
get
{
return this.comprefField;
}
set
{
this.comprefField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public ushort #ref
{
get
{
return this.refField;
}
set
{
this.refField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsComprefStep
{
private stepsComprefStepParameterizedString[] parameterizedStringField;
private object descriptionField;
private byte idField;
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
public stepsComprefStepParameterizedString[] parameterizedString
{
get
{
return this.parameterizedStringField;
}
set
{
this.parameterizedStringField = value;
}
}
/// <remarks/>
public object description
{
get
{
return this.descriptionField;
}
set
{
this.descriptionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsComprefStepParameterizedString
{
private bool isformattedField;
private string valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool isformatted
{
get
{
return this.isformattedField;
}
set
{
this.isformattedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsComprefCompref
{
private stepsComprefComprefStep[] stepField;
private byte idField;
private ushort refField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("step")]
public stepsComprefComprefStep[] step
{
get
{
return this.stepField;
}
set
{
this.stepField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public ushort #ref
{
get
{
return this.refField;
}
set
{
this.refField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsComprefComprefStep
{
private stepsComprefComprefStepParameterizedString[] parameterizedStringField;
private object descriptionField;
private byte idField;
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
public stepsComprefComprefStepParameterizedString[] parameterizedString
{
get
{
return this.parameterizedStringField;
}
set
{
this.parameterizedStringField = value;
}
}
/// <remarks/>
public object description
{
get
{
return this.descriptionField;
}
set
{
this.descriptionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsComprefComprefStepParameterizedString
{
private bool isformattedField;
private string valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool isformatted
{
get
{
return this.isformattedField;
}
set
{
this.isformattedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
The XML that describes the steps with the shared steps can be like this:
<steps id="0" last="14">
<step id="2" type="ValidateStep">
<parameterizedString isformatted="true"><DIV><DIV><P>Step 1</P></DIV></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P>Result 1</P></DIV></parameterizedString>
<description/>
</step>
<compref id="6" ref="8712">
<step id="5" type="ActionStep">
<parameterizedString isformatted="true"><DIV><P>Step 4</P></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P><BR/></P></DIV></parameterizedString>
<description/>
</step>
<step id="7" type="ActionStep">
<parameterizedString isformatted="true"><DIV><P>Step 5</P></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P><BR/></P></DIV></parameterizedString>
<description/>
</step>
<compref id="14" ref="8713">
<step id="10" type="ActionStep">
<parameterizedString isformatted="true"><DIV><DIV><P>Step 8</P></DIV></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P><BR/></P></DIV></parameterizedString>
<description/>
</step>
<step id="11" type="ActionStep">
<parameterizedString isformatted="true"><DIV><DIV><P>Step 9</P></DIV></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P><BR/></P></DIV></parameterizedString>
<description/>
</step>
<step id="12" type="ActionStep">
<parameterizedString isformatted="true"><DIV><DIV><P>Step 10</P></DIV></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P><BR/></P></DIV></parameterizedString>
<description/>
</step>
<step id="13" type="ActionStep">
<parameterizedString isformatted="true"><DIV><DIV><P><BR/></P></DIV></DIV></parameterizedString>
<parameterizedString isformatted="true"><DIV><P><BR/></P></DIV></parameterizedString>
<description/>
</step>
</compref>
</compref>
</steps>
So I don't understand how I can read and manage the test case steps with the shared steps with the API in order to transform this content as a list of the detailed steps (description, expected result).
Could you please advise me?
I tested and found that share steps are referred by ref attribute of compref. The value of ref attribute is actually the id of the shared steps.
The detailed shared steps is not shown within element compref, it only has a ref id to the share step.
The element step which resides under element compref is not the shared steps.
After you get the value of ref which is the id of the shared step. You can call API again to get the detailed steps within a shared step.
GetWorkItemAsync(Int32, IEnumerable<String>, Nullable<DateTime>, Nullable<WorkItemExpand>, Object, CancellationToken)
As you said, the compref xml content is not clear. You might need to redefine your steps class to deserialize the xml content, and use the ref value to call api again.
You're right, I need to read the Shared Step as a work item and read steps from the field "Microsoft.VSTS.TCM.Steps".
I have also changed the xml class "steps" in order to managed sub steps :
// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class steps
{
private stepsStep[] stepField;
private steps comprefField;
private int idField;
private int lastField;
private int refField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("step")]
public stepsStep[] step
{
get
{
return this.stepField;
}
set
{
this.stepField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("compref")]
public steps compref
{
get
{
return this.comprefField;
}
set
{
this.comprefField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public int id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public int last
{
get
{
return this.lastField;
}
set
{
this.lastField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public int #ref
{
get
{
return this.refField;
}
set
{
this.refField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsStep
{
private stepsStepParameterizedString[] parameterizedStringField;
private object descriptionField;
private byte idField;
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
public stepsStepParameterizedString[] parameterizedString
{
get
{
return this.parameterizedStringField;
}
set
{
this.parameterizedStringField = value;
}
}
/// <remarks/>
public object description
{
get
{
return this.descriptionField;
}
set
{
this.descriptionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class stepsStepParameterizedString
{
private bool isformattedField;
private string valueField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool isformatted
{
get
{
return this.isformattedField;
}
set
{
this.isformattedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
The xml content is not really readable ;)
Thanks for your help.
I'm trying to deserialize an XML
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:catalogProductListResponse>
<storeView SOAP-ENC:arrayType="ns1:catalogProductEntity[609]" xsi:type="ns1:catalogProductEntityArray">
<item xsi:type="ns1:catalogProductEntity">
<product_id xsi:type="xsd:string">36</product_id>
<sku xsi:type="xsd:string">000975</sku>
<name xsi:type="xsd:string">Beauty Dermo HTM - Vacuoterapia</name>
<set xsi:type="xsd:string">4</set>
<type xsi:type="xsd:string">simple</type>
<category_ids SOAP-ENC:arrayType="xsd:string[9]" xsi:type="ns1:ArrayOfString">
<item xsi:type="xsd:string">4</item>
</category_ids>
<website_ids SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns1:ArrayOfString">
<item xsi:type="xsd:string">1</item>
</website_ids>
</item>
<item xsi:type="ns1:catalogProductEntity">
<product_id xsi:type="xsd:string">37</product_id>
<sku xsi:type="xsd:string">004279</sku>
<name xsi:type="xsd:string">Effect HTM - RadiofrequĂȘncia</name>
<set xsi:type="xsd:string">4</set>
<type xsi:type="xsd:string">simple</type>
<category_ids SOAP-ENC:arrayType="xsd:string[8]" xsi:type="ns1:ArrayOfString">
<item xsi:type="xsd:string">4</item>
</category_ids>
<website_ids SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns1:ArrayOfString">
<item xsi:type="xsd:string">1</item>
</website_ids>
</item>
...[OTHER MANY ITENS]
</storeView>
</ns1:catalogProductListResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
In this class
public class ProductListResponse
{
// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.xmlsoap.org/soap/envelope/", IsNullable = false)]
public partial class Envelope
{
private EnvelopeBody bodyField;
private string encodingStyleField;
/// <remarks/>
public EnvelopeBody Body
{
get
{
return this.bodyField;
}
set
{
this.bodyField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
public string encodingStyle
{
get
{
return this.encodingStyleField;
}
set
{
this.encodingStyleField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
public partial class EnvelopeBody
{
private catalogProductListResponse catalogProductListResponseField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:Magento")]
public catalogProductListResponse catalogProductListResponse
{
get
{
return this.catalogProductListResponseField;
}
set
{
this.catalogProductListResponseField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:Magento")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "urn:Magento", IsNullable = false)]
public partial class catalogProductListResponse
{
private storeView storeViewField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("storeView")]
public storeView storeView
{
get
{
return this.storeViewField;
}
set
{
this.storeViewField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName = "catalogProductEntityArray")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class storeView
{
private storeViewItem[] itemField;
private string arrayTypeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("item")]
public storeViewItem[] item
{
get
{
return this.itemField;
}
set
{
this.itemField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.xmlsoap.org/soap/encoding/")]
public string arrayType
{
get
{
return this.arrayTypeField;
}
set
{
this.arrayTypeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName = "catalogProductEntity")]
public partial class storeViewItem
{
private ushort product_idField;
private string skuField;
private string nameField;
private byte setField;
private string typeField;
private storeViewItemCategory_ids category_idsField;
private storeViewItemWebsite_ids website_idsField;
/// <remarks/>
public ushort product_id
{
get
{
return this.product_idField;
}
set
{
this.product_idField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
public string sku
{
get
{
return this.skuField;
}
set
{
this.skuField = value;
}
}
/// <remarks/>
public string name
{
get
{
return this.nameField;
}
set
{
this.nameField = value;
}
}
/// <remarks/>
public byte set
{
get
{
return this.setField;
}
set
{
this.setField = value;
}
}
/// <remarks/>
public string type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
/// <remarks/>
public storeViewItemCategory_ids category_ids
{
get
{
return this.category_idsField;
}
set
{
this.category_idsField = value;
}
}
/// <remarks/>
public storeViewItemWebsite_ids website_ids
{
get
{
return this.website_idsField;
}
set
{
this.website_idsField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class storeViewItemCategory_ids
{
private byte[] itemField;
private string arrayTypeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("item")]
public byte[] item
{
get
{
return this.itemField;
}
set
{
this.itemField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.xmlsoap.org/soap/encoding/")]
public string arrayType
{
get
{
return this.arrayTypeField;
}
set
{
this.arrayTypeField = value;
}
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class storeViewItemWebsite_ids
{
private byte itemField;
private string arrayTypeField;
/// <remarks/>
public byte item
{
get
{
return this.itemField;
}
set
{
this.itemField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.xmlsoap.org/soap/encoding/")]
public string arrayType
{
get
{
return this.arrayTypeField;
}
set
{
this.arrayTypeField = value;
}
}
}
}
With the code
var deserializedDocument = SerializacaoHelper.Deserialize<ProductListResponse.Envelope>(xmlDocument);
public static T Deserialize<T>(XmlDocument xmlDoc)
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
MemoryStream xmlStream = new MemoryStream();
xmlDoc.Save(xmlStream);
xmlStream.Position = 0;
T obj = (T)serializer.Deserialize(xmlStream);
xmlStream.Flush();
return obj;
}
The class was generated with the Visual Studio automatic generator. To simulate it is due, with the XML in the clipboard, to follow the steps Edit > Paste Special > Paste XML as Classes.
The function that deserializes is being executed, however, the storeView attribute is null, even having child nodes inside it in the XML.
Where is the error? In class? In the deserialization code? I can not understand why the StoreView attribute is null if in XML it has data.
I am trying to deserialize the following XML
<?xml version="1.0" encoding="UTF-8"?>
<GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
<EnvelopeVersion>2.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>DRUG_DATA</Class>
<Qualifier>response</Qualifier>
<Function>submit</Function>
<CorrelationID>BD694DAAA26AA6068EAAAE5C7746CE54</CorrelationID>
<Transformation>XML</Transformation>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID />
<Authentication>
<Method />
<Role />
<Value />
</Authentication>
</IDAuthentication>
</SenderDetails>
</Header>
<GovTalkDetails>
<Keys>
<Key Type="SpokeName" />
</Keys>
</GovTalkDetails>
<Body>
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Body>
<ns2:getGenericDrugsResponse xmlns:ns2="http://webservice.sirkb/">
<return>
<DRUG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:genericDrug">
<GENERIC_DRUG_ID>147</GENERIC_DRUG_ID>
<GENERIC_DRUG_NAME>Amoxicilline 125mg/5ml - 60ml</GENERIC_DRUG_NAME>
</DRUG>
<DRUG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:genericDrug">
<GENERIC_DRUG_ID>149</GENERIC_DRUG_ID>
<GENERIC_DRUG_NAME>Amoxicilline 250mg/5ml - 60ml</GENERIC_DRUG_NAME>
</DRUG>
<DRUG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:genericDrug">
<DOSAGE>10mg/5ml</DOSAGE>
<GENERIC_DRUG_ID>2312</GENERIC_DRUG_ID>
<GENERIC_DRUG_NAME>Vinorelbine (as vinorelbine tartrate)</GENERIC_DRUG_NAME>
<PHARMACEUTICAL_FORM>concentrate for solution for infusion</PHARMACEUTICAL_FORM>
</DRUG>
<DRUG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:genericDrug">
<DOSAGE>100 u/ml (approximately 0.58mg)</DOSAGE>
<GENERIC_DRUG_ID>2313</GENERIC_DRUG_ID>
<GENERIC_DRUG_NAME>Laronidase</GENERIC_DRUG_NAME>
<PHARMACEUTICAL_FORM>concentrate for solution for infusion</PHARMACEUTICAL_FORM>
</DRUG>
<RETURN_STATUS>SUCCESS</RETURN_STATUS>
</return>
</ns2:getGenericDrugsResponse>
</S:Body>
</S:Envelope>
</Body>
</GovTalkMessage>
I have generated the classes through Paste XML as Classes feature of Visual Studio 2017. (Using the xsd.exe is the same) I have not changed the generated classes.
They have the following form:
// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope", IsNullable = false)]
public partial class GovTalkMessage
{
private decimal envelopeVersionField;
private GovTalkMessageHeader headerField;
private GovTalkMessageGovTalkDetails govTalkDetailsField;
private GovTalkMessageBody bodyField;
/// <remarks/>
public decimal EnvelopeVersion
{
get
{
return this.envelopeVersionField;
}
set
{
this.envelopeVersionField = value;
}
}
/// <remarks/>
public GovTalkMessageHeader Header
{
get
{
return this.headerField;
}
set
{
this.headerField = value;
}
}
/// <remarks/>
public GovTalkMessageGovTalkDetails GovTalkDetails
{
get
{
return this.govTalkDetailsField;
}
set
{
this.govTalkDetailsField = value;
}
}
/// <remarks/>
public GovTalkMessageBody Body
{
get
{
return this.bodyField;
}
set
{
this.bodyField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageHeader
{
private GovTalkMessageHeaderMessageDetails messageDetailsField;
private GovTalkMessageHeaderSenderDetails senderDetailsField;
/// <remarks/>
public GovTalkMessageHeaderMessageDetails MessageDetails
{
get
{
return this.messageDetailsField;
}
set
{
this.messageDetailsField = value;
}
}
/// <remarks/>
public GovTalkMessageHeaderSenderDetails SenderDetails
{
get
{
return this.senderDetailsField;
}
set
{
this.senderDetailsField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageHeaderMessageDetails
{
private string classField;
private string qualifierField;
private string functionField;
private string correlationIDField;
private string transformationField;
/// <remarks/>
public string Class
{
get
{
return this.classField;
}
set
{
this.classField = value;
}
}
/// <remarks/>
public string Qualifier
{
get
{
return this.qualifierField;
}
set
{
this.qualifierField = value;
}
}
/// <remarks/>
public string Function
{
get
{
return this.functionField;
}
set
{
this.functionField = value;
}
}
/// <remarks/>
public string CorrelationID
{
get
{
return this.correlationIDField;
}
set
{
this.correlationIDField = value;
}
}
/// <remarks/>
public string Transformation
{
get
{
return this.transformationField;
}
set
{
this.transformationField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageHeaderSenderDetails
{
private GovTalkMessageHeaderSenderDetailsIDAuthentication iDAuthenticationField;
/// <remarks/>
public GovTalkMessageHeaderSenderDetailsIDAuthentication IDAuthentication
{
get
{
return this.iDAuthenticationField;
}
set
{
this.iDAuthenticationField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageHeaderSenderDetailsIDAuthentication
{
private object senderIDField;
private GovTalkMessageHeaderSenderDetailsIDAuthenticationAuthentication authenticationField;
/// <remarks/>
public object SenderID
{
get
{
return this.senderIDField;
}
set
{
this.senderIDField = value;
}
}
/// <remarks/>
public GovTalkMessageHeaderSenderDetailsIDAuthenticationAuthentication Authentication
{
get
{
return this.authenticationField;
}
set
{
this.authenticationField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageHeaderSenderDetailsIDAuthenticationAuthentication
{
private object methodField;
private object roleField;
private object valueField;
/// <remarks/>
public object Method
{
get
{
return this.methodField;
}
set
{
this.methodField = value;
}
}
/// <remarks/>
public object Role
{
get
{
return this.roleField;
}
set
{
this.roleField = value;
}
}
/// <remarks/>
public object Value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageGovTalkDetails
{
private GovTalkMessageGovTalkDetailsKeys keysField;
/// <remarks/>
public GovTalkMessageGovTalkDetailsKeys Keys
{
get
{
return this.keysField;
}
set
{
this.keysField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageGovTalkDetailsKeys
{
private GovTalkMessageGovTalkDetailsKeysKey keyField;
/// <remarks/>
public GovTalkMessageGovTalkDetailsKeysKey Key
{
get
{
return this.keyField;
}
set
{
this.keyField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageGovTalkDetailsKeysKey
{
private string typeField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Type
{
get
{
return this.typeField;
}
set
{
this.typeField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class GovTalkMessageBody
{
private Envelope envelopeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.w3.org/2003/05/soap-envelope")]
public Envelope Envelope
{
get
{
return this.envelopeField;
}
set
{
this.envelopeField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.w3.org/2003/05/soap-envelope", IsNullable = false)]
public partial class Envelope
{
private EnvelopeBody bodyField;
/// <remarks/>
public EnvelopeBody Body
{
get
{
return this.bodyField;
}
set
{
this.bodyField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
public partial class EnvelopeBody
{
private getGenericDrugsResponse getGenericDrugsResponseField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://webservice.sirkb/")]
public getGenericDrugsResponse getGenericDrugsResponse
{
get
{
return this.getGenericDrugsResponseField;
}
set
{
this.getGenericDrugsResponseField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://webservice.sirkb/")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://webservice.sirkb/", IsNullable = false)]
public partial class getGenericDrugsResponse
{
private #return returnField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public #return #return
{
get
{
return this.returnField;
}
set
{
this.returnField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope", IsNullable = false)]
public partial class #return
{
private returnDRUG[] dRUGField;
private string rETURN_STATUSField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DRUG")]
public returnDRUG[] DRUG
{
get
{
return this.dRUGField;
}
set
{
this.dRUGField = value;
}
}
/// <remarks/>
public string RETURN_STATUS
{
get
{
return this.rETURN_STATUSField;
}
set
{
this.rETURN_STATUSField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class returnDRUG
{
private string dOSAGEField;
private ushort gENERIC_DRUG_IDField;
private string gENERIC_DRUG_NAMEField;
private string pHARMACEUTICAL_FORMField;
/// <remarks/>
public string DOSAGE
{
get
{
return this.dOSAGEField;
}
set
{
this.dOSAGEField = value;
}
}
/// <remarks/>
public ushort GENERIC_DRUG_ID
{
get
{
return this.gENERIC_DRUG_IDField;
}
set
{
this.gENERIC_DRUG_IDField = value;
}
}
/// <remarks/>
public string GENERIC_DRUG_NAME
{
get
{
return this.gENERIC_DRUG_NAMEField;
}
set
{
this.gENERIC_DRUG_NAMEField = value;
}
}
/// <remarks/>
public string PHARMACEUTICAL_FORM
{
get
{
return this.pHARMACEUTICAL_FORMField;
}
set
{
this.pHARMACEUTICAL_FORMField = value;
}
}
}
I get the following error:
System.InvalidOperationException: 'There is an error in XML document (33, 14).'
Inner Exception
InvalidOperationException: The specified type was not recognized:
name='genericDrug', namespace='http://webservice.sirkb/', at http://www.govtalk.gov.uk/CM/envelope'>.
I have noticed from this thread that if I remove xsi:type="ns2:genericDrug" from the XML file I can deserialize the XML. I can't modify the XML because it is the response I get for the request. It is not a good practice to do a string replace on XML, so I am looking for a better solution.
This might be a duplicate question from this one, but since I am not able to solve the problem I am posting it again because it is difficult to get help in the comment section.
Based on the above question I have tried to change the annotation of public partial class returnDRUG
from
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
to
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.w3.org/2001/XMLSchema-instance", TypeName = "genericDrug")]
but still cant parse the XML.
The parsing code is simple
var deserializer = new XmlSerializer(typeof(GovTalkMessage));
TextReader textReader = new StreamReader("drug.xml"); //saved response in file for simplicity
GovTalkMessage response;
response = (GovTalkMessage)deserializer.Deserialize(textReader);
textReader.Close();
What can I do to deserialize the XML in the GovTalkMessage object?
You need to change the decoration on the returnDRUG class
from this
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public partial class returnDRUG
to this
[System.Xml.Serialization.XmlTypeAttribute(TypeName = "genericDrug", Namespace = "http://webservice.sirkb/")]
public partial class returnDRUG
Specify it's type as "genericDrug", and the crucial bit, correct it's namespace to "http://webservice.sirkb/"
I've just used you code and managed to de-serialize using this change.
The explanation is that if you take a look at the definition of DRUG you can see that it's type is defined as "genericDRUG" in the namespace alias "ns2"
<DRUG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:genericDrug">
if you look at the definition of the ns2 alias you can see that it's "http://webservice.sirkb/"
<ns2:getGenericDrugsResponse xmlns:ns2="http://webservice.sirkb/">
Some addition to prevent default values for DRUG objects
Every property of the returnDrug class should have the namespace http://www.govtalk.gov.uk/CM/envelope.
The complete class should have the following form:
[System.Xml.Serialization.XmlTypeAttribute(TypeName = "genericDrug", Namespace = "http://webservice.sirkb/")]
public partial class returnDRUG
{
private string dOSAGEField;
private ushort gENERIC_DRUG_IDField;
private string gENERIC_DRUG_NAMEField;
private string pHARMACEUTICAL_FORMField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public string DOSAGE
{
get
{
return this.dOSAGEField;
}
set
{
this.dOSAGEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public ushort GENERIC_DRUG_ID
{
get
{
return this.gENERIC_DRUG_IDField;
}
set
{
this.gENERIC_DRUG_IDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public string GENERIC_DRUG_NAME
{
get
{
return this.gENERIC_DRUG_NAMEField;
}
set
{
this.gENERIC_DRUG_NAMEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.govtalk.gov.uk/CM/envelope")]
public string PHARMACEUTICAL_FORM
{
get
{
return this.pHARMACEUTICAL_FORMField;
}
set
{
this.pHARMACEUTICAL_FORMField = value;
}
}
}
I have the following xml doc that I am trying to parse:
<report>
<fruit name="Apple" count="5"/>
<vegetable name="Potato" count="2"/>
<vegetable name="Tomato" count="3"/>
<fruit name="Orange" count="0"/>
</report>
I have the following class to deserialize:
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class report
{
private object[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("fruit", typeof(reportFruit))]
[System.Xml.Serialization.XmlElementAttribute("vegetable", typeof(reportVegetable))]
public object[] Items
{
get
{
return this.itemsField;
}
set
{
this.itemsField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class reportFruit
{
private string nameField;
private byte countField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string name
{
get
{
return this.nameField;
}
set
{
this.nameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte count
{
get
{
return this.countField;
}
set
{
this.countField = value;
}
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class reportVegetable
{
private string nameField;
private byte countField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string name
{
get
{
return this.nameField;
}
set
{
this.nameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public byte count
{
get
{
return this.countField;
}
set
{
this.countField = value;
}
}
}
How can I iterate through the fruits and vegetables after it has been deserialized?
foreach (string name in instance.Items) // doesnt work
You can do this:
for(int i = 0; i < instance.Items.Length; i++)
{
object item = instance.Items[i];
if(item is reportFruit) {
// it is a fruit!!!
reportFruit fruit = (reportFruit)item;
}
if(item is reportVegetable) {
// it is not a fruit :'(
reportVegetable vegetable = (reportVegetable)item;
}
}
Using XSD.EXE I generated a *.cs file to serialize XML. When I serialize I get the error
"The same table 'DefaultFont' cannot be the child table in two nested relations."
Why do I receive the error? Can I fix the error without using XSLT transforms?
Code to serialize
StreamReader fs = new StreamReader(#"C:\path\DocumentSample.xml");
XmlSerializer serializer = new XmlSerializer(typeof(PhysDocDocument));
var result = serializer.Deserialize(fs) as PhysDocDocument;//exception thrown here
Sample XML
<PhysDocDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PhysDocNode HeaderVisible="true" Display="Summary" IsCollapsed="false" CopyForwardEnabled="true" IsHidden="false" Borders="false">
<LinkedPluginId>00000000-0000-0000-0000-000000000000</LinkedPluginId>
<Plugin xsi:type="PromptPlugin" ID="2446441e-6eb2-49ef-b8e3-28f638755b75">
<CopyForwardChecked>true</CopyForwardChecked>
<PromptBase xsi:type="MemoPrompt">
<Label>Comment</Label>
<DocumentValue>
<Paragraphs />
<DefaultFont FontFamily="Arial" SizeInPoints="10" Style="Regular" />
</DocumentValue>
<ShowLabel>false</ShowLabel>
<RenderHeader>false</RenderHeader>
</PromptBase>
</Plugin>
</PhysDocNode>
</PhysDocDocument>
Generated Code
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Xml.Serialization;
//
// This source code was auto-generated by xsd, Version=4.0.30319.1.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class PhysDocDocument
{
private PhysDocDocumentPhysDocNode[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PhysDocNode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNode[] Items
{
get
{
return this.itemsField;
}
set
{
this.itemsField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNode
{
private string linkedPluginIdField;
private PhysDocDocumentPhysDocNodePlugin[] pluginField;
private string headerVisibleField;
private string displayField;
private string isCollapsedField;
private string copyForwardEnabledField;
private string isHiddenField;
private string bordersField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LinkedPluginId
{
get
{
return this.linkedPluginIdField;
}
set
{
this.linkedPluginIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Plugin", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePlugin[] Plugin
{
get
{
return this.pluginField;
}
set
{
this.pluginField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string HeaderVisible
{
get
{
return this.headerVisibleField;
}
set
{
this.headerVisibleField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Display
{
get
{
return this.displayField;
}
set
{
this.displayField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string IsCollapsed
{
get
{
return this.isCollapsedField;
}
set
{
this.isCollapsedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string CopyForwardEnabled
{
get
{
return this.copyForwardEnabledField;
}
set
{
this.copyForwardEnabledField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string IsHidden
{
get
{
return this.isHiddenField;
}
set
{
this.isHiddenField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Borders
{
get
{
return this.bordersField;
}
set
{
this.bordersField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNodePlugin
{
private string copyForwardCheckedField;
private PhysDocDocumentPhysDocNodePluginPromptBase[] promptBaseField;
private string idField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CopyForwardChecked
{
get
{
return this.copyForwardCheckedField;
}
set
{
this.copyForwardCheckedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PromptBase", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePluginPromptBase[] PromptBase
{
get
{
return this.promptBaseField;
}
set
{
this.promptBaseField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string ID
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNodePluginPromptBase
{
private string labelField;
private string showLabelField;
private string renderHeaderField;
private PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValue[] documentValueField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Label
{
get
{
return this.labelField;
}
set
{
this.labelField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ShowLabel
{
get
{
return this.showLabelField;
}
set
{
this.showLabelField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string RenderHeader
{
get
{
return this.renderHeaderField;
}
set
{
this.renderHeaderField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DocumentValue", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValue[] DocumentValue
{
get
{
return this.documentValueField;
}
set
{
this.documentValueField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValue
{
private string paragraphsField;
private PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValueDefaultFont[] defaultFontField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Paragraphs
{
get
{
return this.paragraphsField;
}
set
{
this.paragraphsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DefaultFont", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValueDefaultFont[] DefaultFont
{
get
{
return this.defaultFontField;
}
set
{
this.defaultFontField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValueDefaultFont
{
private string fontFamilyField;
private string sizeInPointsField;
private string styleField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string FontFamily
{
get
{
return this.fontFamilyField;
}
set
{
this.fontFamilyField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string SizeInPoints
{
get
{
return this.sizeInPointsField;
}
set
{
this.sizeInPointsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Style
{
get
{
return this.styleField;
}
set
{
this.styleField = value;
}
}
}
Some of your generated classes have AnonymousType=true set in XmlTypeAttribute.
When I modify this and add real class names - the error goes away. Here's full working sample (note that I added 'MemoPrompt' and 'PromptPlugin' class names to XmlTypeAttribute):
using System.Xml.Serialization;
using System.IO;
using System;
class App
{
static void Main()
{
StreamReader fs = new StreamReader(#"sample.xml");
XmlSerializer serializer = new XmlSerializer(typeof(PhysDocDocument));
var result = serializer.Deserialize(fs) as PhysDocDocument;
Console.WriteLine(result);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class PhysDocDocument
{
private PhysDocDocumentPhysDocNode[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PhysDocNode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNode[] Items
{
get
{
return this.itemsField;
}
set
{
this.itemsField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNode
{
private string linkedPluginIdField;
private PhysDocDocumentPhysDocNodePlugin[] pluginField;
private string headerVisibleField;
private string displayField;
private string isCollapsedField;
private string copyForwardEnabledField;
private string isHiddenField;
private string bordersField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LinkedPluginId
{
get
{
return this.linkedPluginIdField;
}
set
{
this.linkedPluginIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Plugin", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePlugin[] Plugin
{
get
{
return this.pluginField;
}
set
{
this.pluginField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string HeaderVisible
{
get
{
return this.headerVisibleField;
}
set
{
this.headerVisibleField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Display
{
get
{
return this.displayField;
}
set
{
this.displayField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string IsCollapsed
{
get
{
return this.isCollapsedField;
}
set
{
this.isCollapsedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string CopyForwardEnabled
{
get
{
return this.copyForwardEnabledField;
}
set
{
this.copyForwardEnabledField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string IsHidden
{
get
{
return this.isHiddenField;
}
set
{
this.isHiddenField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Borders
{
get
{
return this.bordersField;
}
set
{
this.bordersField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute("PromptPlugin")]
public partial class PhysDocDocumentPhysDocNodePlugin
{
private string copyForwardCheckedField;
private PhysDocDocumentPhysDocNodePluginPromptBase[] promptBaseField;
private string idField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CopyForwardChecked
{
get
{
return this.copyForwardCheckedField;
}
set
{
this.copyForwardCheckedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PromptBase", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePluginPromptBase[] PromptBase
{
get
{
return this.promptBaseField;
}
set
{
this.promptBaseField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string ID
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute("MemoPrompt")]
public partial class PhysDocDocumentPhysDocNodePluginPromptBase
{
private string labelField;
private string showLabelField;
private string renderHeaderField;
private PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValue[] documentValueField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Label
{
get
{
return this.labelField;
}
set
{
this.labelField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ShowLabel
{
get
{
return this.showLabelField;
}
set
{
this.showLabelField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string RenderHeader
{
get
{
return this.renderHeaderField;
}
set
{
this.renderHeaderField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DocumentValue", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValue[] DocumentValue
{
get
{
return this.documentValueField;
}
set
{
this.documentValueField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValue
{
private string paragraphsField;
private PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValueDefaultFont[] defaultFontField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Paragraphs
{
get
{
return this.paragraphsField;
}
set
{
this.paragraphsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DefaultFont", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValueDefaultFont[] DefaultFont
{
get
{
return this.defaultFontField;
}
set
{
this.defaultFontField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class PhysDocDocumentPhysDocNodePluginPromptBaseDocumentValueDefaultFont
{
private string fontFamilyField;
private string sizeInPointsField;
private string styleField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string FontFamily
{
get
{
return this.fontFamilyField;
}
set
{
this.fontFamilyField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string SizeInPoints
{
get
{
return this.sizeInPointsField;
}
set
{
this.sizeInPointsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Style
{
get
{
return this.styleField;
}
set
{
this.styleField = value;
}
}
}