TodyGoaxogy
New Member
my class definition is given below, I want to have "SearchSchemesResponse" appear once in the XmlElement , but it appears 2 times in the XmlResponse , please have a look at the XmlResponse and let me know , how do i get rid off the second SearchSchemesResponse , Thanks in Advance.\[quote\]\[code\][XmlRoot(ElementName="" , Namespace = "Compare.Services")]public class SearchSchemesResponse{ [XmlElement("QuoteResult")] public QuoteResult[] SearchSchemesResult { get; set; }}public class QuoteResult{ public QuoteResult() { } public string Currency { get; set; } public double MedicalCost { get; set; } public double PolicyCost { get; set; } public double PolicyIPT { get; set; } public int MyProperty { get; set; } public string ReturnPage { get; set; } public string QuoteRef { get; set; } public string PolicyWordingDocumentURL { get; set; } public string KeyFactsDocumentURL { get; set; } public double MedicalExpensesExcess { get; set; } public double MedicalExpensesCover { get; set; } public double BaggageCover { get; set; } public double BaggageExcess { get; set; } public double CancellationCover { get; set; } public double CancellationExcess { get; set; }}\[/code\]\[/quote\]when I sent this data xmlelement via WCF, I received the following\[code\]<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SearchSchemesResponse xmlns="CompareYourTravelInsurance.Services"> <SearchSchemesResult> **<SearchSchemesResponse>** <QuoteResult> <Currency>GBP</Currency> <MedicalCost>36</MedicalCost> <PolicyCost>81.77</PolicyCost> <PolicyIPT>13.63</PolicyIPT> <MyProperty>0</MyProperty> <ReturnPage>http</ReturnPage> <QuoteRef>200</QuoteRef> <PolicyWordingDocumentURL>http</PolicyWordingDocumentURL> <KeyFactsDocumentURL>http</KeyFactsDocumentURL> <MedicalExpensesExcess>3232</MedicalExpensesExcess> <MedicalExpensesCover>444</MedicalExpensesCover> <BaggageCover>300</BaggageCover> <BaggageExcess>0</BaggageExcess> <CancellationCover>500</CancellationCover> <CancellationExcess>400</CancellationExcess> <DestinationName>test</DestinationName> <SchemeName>3694</SchemeName> <SchemeDisplayName>Economy Insurefor Direct 2012</SchemeDisplayName> <Countries>Sri Lanka,UK</Countries> <QuoteRequestRef>8bd1f476-f4e8-4a2b-a489-5291e4adc6f2</QuoteRequestRef> <MaxTripDays>60</MaxTripDays> <SchemeCoverList> <SchemeCover> <CoverSectionName>Medical</CoverSectionName> <CoverSectionLimit>5000000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Emergency Dental Treatment</CoverSectionName> <CoverSectionLimit>350</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Additional Accommodation and Travelling Costs</CoverSectionName> <CoverSectionLimit>2000</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Hospital Daily Benefit</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Cancellation and Curtailment</CoverSectionName> <CoverSectionLimit>1000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Travel Delay</CoverSectionName> <CoverSectionLimit>150</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Missed Departure on the outward journey</CoverSectionName> <CoverSectionLimit>500</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Personal Possessions</CoverSectionName> <CoverSectionLimit>1000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Money and Passport</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Personal Liability</CoverSectionName> <CoverSectionLimit>2000000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Personal Accident</CoverSectionName> <CoverSectionLimit>10000</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Legal Protection</CoverSectionName> <CoverSectionLimit>10000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Hijack</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Catastrophe</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Withdrawal Of Services</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Pet care</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Ski Equipment (optional)</CoverSectionName> <CoverSectionLimit>350</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Ski Hire (optional)</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Ski Pack (optional)</CoverSectionName> <CoverSectionLimit>300</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Piste Closure (optional)</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Avalanche/Landslide (optional)</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Golf Equipment (optional)</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Business Equipment (optional)</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Car Hire Excess Insurance (Optional)</CoverSectionName> <CoverSectionLimit>2000</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> </SchemeCoverList> </QuoteResult> </SearchSchemesResponse> </SearchSchemesResult> </SearchSchemesResponse> </s:Body></s:Envelope>\[/code\]but I want the output like the following\[code\] <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SearchSchemesResponse xmlns="CompareYourTravelInsurance.Services"> <SearchSchemesResult> <QuoteResult> <Currency>GBP</Currency> <MedicalCost>36</MedicalCost> <PolicyCost>81.77</PolicyCost> <PolicyIPT>13.63</PolicyIPT> <MyProperty>0</MyProperty> <ReturnPage>http</ReturnPage> <QuoteRef>200</QuoteRef> <PolicyWordingDocumentURL>http</PolicyWordingDocumentURL> <KeyFactsDocumentURL>http</KeyFactsDocumentURL> <MedicalExpensesExcess>3232</MedicalExpensesExcess> <MedicalExpensesCover>444</MedicalExpensesCover> <BaggageCover>300</BaggageCover> <BaggageExcess>0</BaggageExcess> <CancellationCover>500</CancellationCover> <CancellationExcess>400</CancellationExcess> <DestinationName>test</DestinationName> <SchemeName>3694</SchemeName> <SchemeDisplayName>Economy Insurefor Direct 2012</SchemeDisplayName> <Countries>Sri Lanka,UK</Countries> <QuoteRequestRef>8bd1f476-f4e8-4a2b-a489-5291e4adc6f2</QuoteRequestRef> <MaxTripDays>60</MaxTripDays> <SchemeCoverList> <SchemeCover> <CoverSectionName>Medical</CoverSectionName> <CoverSectionLimit>5000000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Emergency Dental Treatment</CoverSectionName> <CoverSectionLimit>350</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Additional Accommodation and Travelling Costs</CoverSectionName> <CoverSectionLimit>2000</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Hospital Daily Benefit</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Cancellation and Curtailment</CoverSectionName> <CoverSectionLimit>1000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Travel Delay</CoverSectionName> <CoverSectionLimit>150</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Missed Departure on the outward journey</CoverSectionName> <CoverSectionLimit>500</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Personal Possessions</CoverSectionName> <CoverSectionLimit>1000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Money and Passport</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Personal Liability</CoverSectionName> <CoverSectionLimit>2000000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Personal Accident</CoverSectionName> <CoverSectionLimit>10000</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Legal Protection</CoverSectionName> <CoverSectionLimit>10000</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Hijack</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Catastrophe</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Withdrawal Of Services</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Pet care</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Ski Equipment (optional)</CoverSectionName> <CoverSectionLimit>350</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Ski Hire (optional)</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Ski Pack (optional)</CoverSectionName> <CoverSectionLimit>300</CoverSectionLimit> <CoverSectionExcess>125</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Piste Closure (optional)</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Avalanche/Landslide (optional)</CoverSectionName> <CoverSectionLimit>200</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Golf Equipment (optional)</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Business Equipment (optional)</CoverSectionName> <CoverSectionLimit>0</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> <SchemeCover> <CoverSectionName>Car Hire Excess Insurance (Optional)</CoverSectionName> <CoverSectionLimit>2000</CoverSectionLimit> <CoverSectionExcess>0</CoverSectionExcess> </SchemeCover> </SchemeCoverList> </QuoteResult> </SearchSchemesResult> </SearchSchemesResponse> </s:Body> </s:Envelope>\[/code\]Please help me out on this problem.Thanks-Chandra