Create a WCF Service that gets info from an atom feed

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 2291 Views - Last Post: 21 January 2014 - 05:36 AM Rate Topic: -----

#1 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 02:43 AM

Ok so as a brand new developer my first project is to create a WCF Service. I'm a little stuck here as I have an xml file(atom feed) that I need to get data out of. I'm totally lost as to what and how to get the info. I've read up on WCF syndication but the examples and articles don't seem to match to what I need to do. I've attached the file I need to use. But to me it seems strange that I would really have to include everything.

So my questions are - what info should I concentrate on getting out of the file?
And how exactly do I get the service to understand it so that it can pass on the info?

Is This A Good Question/Topic? 0
  • +

Replies To: Create a WCF Service that gets info from an atom feed

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6537
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 05:15 AM

I know this isn't what you want to hear but it is probably what you need to hear...

As a brand new developer you aren't equipped to write this. You need to work on learning the C# language and foundation concepts. You can't just walk up to a brand new language and start architectonic solutions. Thinking that you can is either incredibly egotistical on your your part, or completing insulting to those that do this for a living.

You wouldn't try architectonic a house by buying a semi-trailer of materials and just hammer stuff together to see how it stands. The same goes with coding. You can't just start typing away with no training and think you will somehow get a good solution in the end.

The home page of the C# forum has a list of good books to start with.
Was This Post Helpful? 0
  • +
  • -

#3 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 06:33 AM

Ok, yes that was harsh, but this is what I've been asked to do and I'm not exactly one to say "I can't do it" (we can blame that on an ego if you want, haha)

I just would like some assistance, I have got the basics of C# but it's not enough I know, which is why I'm here.

So either I need to tell my employer that this is too advanced or I need to try and try :(
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7509
  • View blog
  • Posts: 25,286
  • Joined: 05-May 12

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 06:37 AM

Did you even try using the Load() function as part of your initial research?
Was This Post Helpful? 0
  • +
  • -

#5 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 07:21 AM

Well from what I understand, you can't just use the xml reader. I understood that I had to create objects from each element in the xml file. But the thing is, the file has so many elements, I find it hard to believe that I have to create each one manually.

I can't seem to attach the file to show you though
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7509
  • View blog
  • Posts: 25,286
  • Joined: 05-May 12

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 07:23 AM

If you have an XML file, you can use the XmlReader to read the file. Why would you try to parse the file yourself just to turn around and build an XML Document manually?
Was This Post Helpful? 0
  • +
  • -

#7 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 07:52 AM

I'm not building the XML document manually, I meant create an object from each element manually. and it's not a normal simple XML, it's an ATOM feed, and as far as I've seen and heard, the XML reader does not work for ATOM feeds
Was This Post Helpful? 0
  • +
  • -

#8 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 11:53 AM

You might be able to use the info in this thread:

http://stackoverflow...rss-feed-in-net
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7509
  • View blog
  • Posts: 25,286
  • Joined: 05-May 12

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 12:22 PM

View PostScubaCode, on 03 January 2014 - 09:52 AM, said:

It's not a normal simple XML, it's an ATOM feed, and as far as I've seen and heard, the XML reader does not work for ATOM feeds

Where did you see and hear that the XML Reader does not work?

An ATOM feed is XML compliant. According to the RFC for ATOM it is XML: http://tools.ietf.org/search/rfc4287
Was This Post Helpful? 0
  • +
  • -

#10 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Create a WCF Service that gets info from an atom feed

Posted 03 January 2014 - 03:14 PM

By the way, you did not attach the file you said you did in your original post.
Was This Post Helpful? 0
  • +
  • -

#11 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Re: Create a WCF Service that gets info from an atom feed

Posted 05 January 2014 - 05:59 AM

Like I said, very new, so still trying to wrap my head around everything. I can't seem to attach the file to show you.

As far as reading up and trying to ask, I keep getting the answer syndication, but to me that looks as though I want to create an ATOM feed, I just want to get all the info out of it and into my WCF Service so that I can get my app to access that WCF Service and see the data. I hope I'm making sense here.

This is a snippet of the file I have to read:


<?xml version="1.0" encoding="UTF-16"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:wplc="http://www.ibm.com/wplc/atom/1.0" xmlns:age="http://purl.org/atompub/age/1.0" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:lconn="http://www.ibm.com/lotus/connections/seedlist/atom/1.0">
<atom:id>https://lhe6.cloudapp.net/wikis/seedlist/myserver?Action=GetDocuments&amp;Format=ATOM&amp;Locale=null&amp;Range=100&amp;Start=0</atom:id>
<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>
<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"/>
<wplc:fieldInfo id="FIELD_RECOMMENDATIONS_COUNT" name="Recommendations count" description="Number of recommendations" type="int" contentSearchable="false" fieldSearchable="false" parametric="false" returnable="true" sortable="true" supportsExactMatch="true"/>
<wplc:fieldInfo id="FIELD_LIBRARY_DBINTERNAL_UID" name="library database internal UID" description="library database internal UID" type="string" contentSearchable="false" fieldSearchable="false" parametric="false" returnable="true" sortable="true" supportsExactMatch="true"/>
<wplc:fieldInfo id="FIELD_LIBRARY_DBINTERNAL_NAME" name="library database internal name" description="library database internal name" type="string" contentSearchable="false" fieldSearchable="false" parametric="false" returnable="true" sortable="false" supportsExactMatch="false"/>

This post has been edited by JackOfAllTrades: 07 January 2014 - 08:52 AM
Reason for edit:: Added code tags

Was This Post Helpful? 0
  • +
  • -

#12 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7509
  • View blog
  • Posts: 25,286
  • Joined: 05-May 12

Re: Create a WCF Service that gets info from an atom feed

Posted 05 January 2014 - 09:34 AM

If you need to load the data, look at post #4.
Was This Post Helpful? 0
  • +
  • -

#13 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Re: Create a WCF Service that gets info from an atom feed

Posted 06 January 2014 - 03:15 AM

But that's the thing, do I need to just load it or read it or what?

The atom feeds exist already. But I want to view the info and it should take me to the original content.

I know I'm probably not explaining it properly.
Was This Post Helpful? 0
  • +
  • -

#14 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7509
  • View blog
  • Posts: 25,286
  • Joined: 05-May 12

Re: Create a WCF Service that gets info from an atom feed

Posted 06 January 2014 - 06:31 AM

You'll need to read the Links properties from the feed after you load it to take you to the original content. I'm confused as to why you would want to view it. You are writing a WCF service, you shouldn't have any need to view the original content.
Was This Post Helpful? 0
  • +
  • -

#15 ScubaCode   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 03-January 14

Re: Create a WCF Service that gets info from an atom feed

Posted 07 January 2014 - 01:47 AM

by original content I mean the webpage with all the blog entries, for example.

The page generates an atom feed(some else did that) and I need to read that atom feed so that, on my site, I can see the content from this other page where all the blogs are.

So, how do I get this done?
I just need a point in the right direction.

I hope I've explained it better this time
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2