Hi all, I'm a newbie in .net xml programming, so please be patient. And
sorry for my uncorrect english, too.
I'm going to explain my problem:
I've built a web service which responds to ferries timetable requests.
It receives an xml document with this format:
<TimeTableRequest>
<Routes>
<Route>
<Company></Company>
<DeparturePort>ptf</DeparturePort>
<ArrivalPort>pio</ArrivalPort>
<Date>2006-12-20T13:00:00</Date>
</Route>
<Route>
<Company></Company>
<DeparturePort>pio</DeparturePort>
<ArrivalPort>ptf</ArrivalPort>
<Date>2006-12-23T15:00:00</Date>
</Route>
</Routes>
</TimeTableRequest>
I deserialize the xml file to a TimeTableRequest object through xml
methods provided by C# 2005. Then I query the mysql (rel.5) database
with those parameters and I'd need back an XML file with this format:
<TimeTableResponse>
<Solutions>
<Solution>
<Company>trm</Company>
<DeparturePort>ptf</DeparturePort>
<ArrivalPort>pio</ArrivalPort>
<DepartureDate>2006-12-23T05:10:00+01:00</DepartureDate>
<ArrivalDate>2006-12-23T06:10:00+01:00</ArrivalDate>
<FareRule>Bassa Stagione</FareRule>
</Solution>
<Solution>
<Company>trm</Company>
<DeparturePort>ptf</DeparturePort>
<ArrivalPort>pio</ArrivalPort>
<DepartureDate>2006-12-22T05:10:00+01:00</DepartureDate>
<ArrivalDate>2006-12-22T06:10:00+01:00</ArrivalDate>
<FareRule>Bassa Stagione</FareRule>
</Solution>
</Solutions>
</TimeTableResponse>
Querying the db, I obtain a dataset, and then the xml from it, through
the method GetXml(), but this method gave me an object like this:
<TimeTableResponse>
<Solution>
<Company>trm</Company>
<DeparturePort>ptf</DeparturePort>
<ArrivalPort>pio</ArrivalPort>
<DepartureDate>2006-12-23T05:10:00+01:00</DepartureDate>
<ArrivalDate>2006-12-23T06:10:00+01:00</ArrivalDate>
<FareRule>Bassa Stagione</FareRule>
</Solution>
...
</TimeTableResponse>
i.e. without the "Solutions" (plural) tag. I got this xml loading the
schema file (.xsd) in the dataset, but keeps ignoring that tag. How can
obtain an exact mapping to the schema?
Thanks in advance.