Koray Kırdinli

Yazılım ve İş Yaşamı Hakkında Paylaşımlar

Servise XML Data post etmek

string requestLoginXml = “<?xml version=\”1.0\” encoding=\”utf-8\” ?>\n<xxx><yyy>1.0</yyyy></xxx>”;

WebClient client = new WebClient();
byte[] loginBytes = client.UploadValues(“Web service URL”, “POST”, new NameValueCollection { { “data”, requestLoginXml } });
string responseLoginXml = Encoding.UTF8.GetString(loginBytes);

XmlDocument xml = new XmlDocument();
xml.LoadXml(responseLoginXml);
XmlNodeList xmlList = xml.SelectNodes(“/ELEMENT”);

string result = xmlList[0][“ELEMENT_NODE”].InnerText;

August 9, 2012 - Posted by | ASP.NET, C# | , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s