I am very new to programming and my first task is to create a WCF service that will take an ATOM feed and expose it to my application. Now, I've read up on XML serialization and syndication but it doesn't seem to be what I need in my (lack of) experience.
Here is a snippet of the feed. It's generated by a seedlist spi
<atom:generator version="1.2" lconn:version="4.5.0.0">
Seedlist Service Backend System</atom:generator>
<wplc:timestamp isPartial="false">AAABQtdnfpE=</wplc:timestamp>
<atom:category term="ContentSourceType/Wikis" scheme="com.ibm.wplc.taxonomy://feature_taxonomy"
label="Wikis"/>
<atom:title>Wikis : 0 entries of Seedlist WIKIS</atom:title>
<atom:updated>2013-12-09T13:49:13+01:00</atom:updated>
Do I need to create objects for all these elements?
And what about these wplc elements?
<wplc:action do="update"/>
<wplc:fieldInfo id="FIELD_ENTRY_TYPE" name="item type"
description="item type - page, file or wiki" type="string"
contentSearchable="false" fieldSearchable="true"
parametric="false" returnable="true" sortable="false"
supportsExactMatch="false"/>
<wplc:fieldInfo id="FIELD_TAG" name="Tag"
description="Document tag" type="string"
contentSearchable="true" fieldSearchable="true"
parametric="false" returnable="true" sortable="false"
supportsExactMatch="true"/>
All the examples, tutorials and explanations I find are of simple xml files So can I just use XML Reader to achieve this? And if so, I need some help.
Here is a sample WCF I found:
public class Service1 : IService1
{
public string GetData(string value)
{
WebRequest request = WebRequest.Create("http://wheremyxmlis/file.xml");
WebResponse response = request.GetResponse();
Stream dataStream = response.GetResponseStream();
XmlReader reader = XmlReader.Create("http://wheremyxmlis/file.xml");
reader = new XmlTextReader("http://wheremyxmlis.xml");
try
{
reader = new XmlTextReader("http://wheremyxmlis/file.xml");
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
Console.Write("<{0}>", reader.Name);
break;
case XmlNodeType.Text:
Console.Write(reader.Value);
break;
case XmlNodeType.CDATA:
Console.Write("<![CDATA[{0}]]>", reader.Value);
break;
case XmlNodeType.ProcessingInstruction:
Console.Write("<?{0} {1}?>", reader.Name, reader.Value);
break;
case XmlNodeType.Comment:
Console.Write("<!--{0}-->", reader.Value);
break;
case XmlNodeType.XmlDeclaration:
Console.Write("<?xml version='1.0'?>");
break;
case XmlNodeType.Document:
break;
case XmlNodeType.DocumentType:
Console.Write("<!DOCTYPE {0} [{1}]", reader.Name, reader.Value);
break;
case XmlNodeType.EntityReference:
Console.Write(reader.Name);
break;
case XmlNodeType.EndElement:
Console.Write("</{0}>", reader.Name);
break;
}
}
}
finally
{
if (reader != null)
reader.Close();
response.Close();