WCF 服务中的 LINQ to XML
我正在使用 VS 2008。我必须创建一个 wcf 服务,并且在该服务内我必须使用 LINQ to XML 对 xml 文件执行一些基本操作。我必须在 IIS 7.0 中托管该服务并使用它。
作为 LINQ to XML 的一部分,我必须执行以下任务:
- 找到所有查询中答案不修改的
- 问题和答案的所有问题 id="Enquiry2"
下面粘贴的是 XML 文件
<b:ServeySet xmlns:b="b:urn:schemas-microsoft-com">
<b:Enquires>
<b:Enquiry id="Enquiry1">
<b:Question id="1" question="is the summer hot in LA?" answer="yes"/>
<b:Question id="3" question="is this hard exercise?" answer="no"/>
<b:Question id="2" question="is this awesome?" answer="yes"/>
</b:Enquiry >
<b:Enquiry id="Enquiry2">
<b:Question id="1" question="what is SFO?" answer="City"/>
<b:Question id="2" question="is this hard exercise?" answer="no"/>
</b:Enquiry >
</b:Enquires>
</b:ServeySet>
I am using VS 2008. I have to create a wcf service and inside the service i have to do some basic operations on a xml file using LINQ to XML. I have to host the service in IIS 7.0 and consume it.
As part of the LINQ to XML I have to do the following tasks :
- find all the questions in all the Enquiry that answers are no
- modify the question and answer of Enquiry id="Enquiry2"
Pasted below is the XML file
<b:ServeySet xmlns:b="b:urn:schemas-microsoft-com">
<b:Enquires>
<b:Enquiry id="Enquiry1">
<b:Question id="1" question="is the summer hot in LA?" answer="yes"/>
<b:Question id="3" question="is this hard exercise?" answer="no"/>
<b:Question id="2" question="is this awesome?" answer="yes"/>
</b:Enquiry >
<b:Enquiry id="Enquiry2">
<b:Question id="1" question="what is SFO?" answer="City"/>
<b:Question id="2" question="is this hard exercise?" answer="no"/>
</b:Enquiry >
</b:Enquires>
</b:ServeySet>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样的事情:
Try something like this: