์๋ ํ์ธ์, ์ ๋ Windows Phone 7.1 ํ๋ก์ ํธ์์ RestSharp๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์ฌ๊ธฐ์ XML ํ์์ ์๋ต์ด ์์ต๋๋ค.
https://skydrive.live.com/redir.aspx?cid=0b39f4fbbb0489dd&resid=B39F4FBBB0489DD!139 &parid=B39F4FBBB0489DD!103&authkey=!AOdT-FiS6Mw8v5Y
ํด๋น ์๋ต์ ํด๋์ค์ ์ญ์ง๋ ฌํํ๋ ค๊ณ ํ์ต๋๋ค.
public class fullWall
{
public _user user { get; set; }
public int numberOfFriend { get; set; }
public int numberOfPhoto { get; set; }
public List<timhotPhotos> timhotPhotos { get; set; }
public fullWall()
{
timhotPhotos = new List<timhotPhotos>();
}
}
์ฌ๊ธฐ์์ ๋ณผ ์ ์๋ฏ์ด timhotPhotos
๋ชฉ๋ก์ ์ ์ธํ ๋ชจ๋ ์์ฑ์ ๊ด์ฐฎ์ต๋๋ค.
timhotPhotos ํด๋์ค:
public class timhotPhotos
{
public string id { get; set; }
public string title { get; set; }
public string description { get; set; }
public string url { get; set; }
public double width { get; set; }
public double height { get; set; }
public DateTime createdDate { get; set; }
public _user user { get; set; }
public int numOfComment { get; set; }
public int numOfRate { get; set; }
public int numOfView { get; set; }
public bool rated { get; set; }
}
๋ด๊ฐ ์ด๋์์ ์๋ชป ๋์์ต๋๊น?
StackOverflow์์ ๊ทํ์ ์ง๋ฌธ ์ ๋ณด์๊ณ ๊ฑฐ๊ธฐ์ ๋ต์ฅํ์ผ๋ฉฐ ์ด์ ์ฌ๊ธฐ์ ๋ด ๋ต์ฅ์ ๋ณต์ฌํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ๊ธฐ๋ณธ XML deserializer๋ฅผ DotNetXmlDeserializer๋ก ๋ณ๊ฒฝํด์ผ ํฉ๋๋ค.
RestClient client;
client.AddHandler("application/xml", new DotNetXmlDeserializer());
๊ทธ๋ฐ ๋ค์ ๋ชฉ๋ก์ XmlElement ํน์ฑ์ ์ถ๊ฐํฉ๋๋ค.
public class fullWall
{
public _user user { get; set; }
public int numberOfFriend { get; set; }
public int numberOfPhoto { get; set; }
[System.Xml.Serialization.XmlElement()]
public List<timhotPhotos> timhotPhotos { get; set; }
public fullWall()
{
timhotPhotos = new List<timhotPhotos>();
}
}
์ด์ ์ ์๋ํด์ผ ํฉ๋๋ค!
๊ทธ๋ฆฌ๊ณ StackOverflow์์ ๋ต๋ณ์ ์๋ฝํ์ผ๋ฏ๋ก ์ด ๋ฌธ์ ๋ฅผ ์ข ๋ฃํ๊ฒ ์ต๋๋ค. ;)
์ค ๊ฐ์ฌ :)
Ps: ์ ๋ 21์ธ ์๋ ์ ๋๋ค. ๋ง๋์ ๋ฐ๊ฐ์์ :)
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ค ๊ฐ์ฌ :)
Ps: ์ ๋ 21์ธ ์๋ ์ ๋๋ค. ๋ง๋์ ๋ฐ๊ฐ์์ :)