带有xml的wcf服务 [英] wcf service with xml

查看:51
本文介绍了带有xml的wcf服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用wcf服务,因为它以xml格式返回值,但是没有xml文件名来简单地显示其中的属性结果,我正在获取此代码,

i am using wcf service in that it returns the values in xml format but that doesn''t have xml file name that simply shows the result in attributes in that , i am getting this code,

strXmlFromWcf = "<arrayofstring xmlns="\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\"" xmlns:i="\"http://www.w3.org/2001/XMLSchema-instance\""><string>1</string><string>2</string><string>3</string></arrayofstring>"  




我需要获取这些值1,2,3 ..为此,我正在使用





i need to get those values 1,2,3..for this i am using


if (doc.DocumentElement != null)
           {
               string res = doc.DocumentElement.InnerText;
               txtEmail.Text = res;
           }



但是在这里,我得到的结果是123,我需要通过单个属性来获得结果.
我需要访问那些属性以存储在变量中...
请帮助我...感谢您在广告中......



but here i am getting the result as 123 i need to get result by single attribute.
i need to access those attributes to store in variables ...
please help me...thank u in adv....

推荐答案

您是否尝试过使用innerxml进行访问?
hve you tried accessing using innerxml?


尝试使用

node.getElementsByTagName("tagname");

Try using

node.getElementsByTagName("tagname");

x=xmlDoc.getElementsByTagName("string");

for (i=0;i<x.length;i++)

  {

  document.write(x[i].childNodes[0].nodeValue);

  document.write("<br />");
  }


这篇关于带有xml的wcf服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆