【发布时间】:2019-11-09 22:15:47
【问题描述】:
我有 xml 请求,我需要为列表结构生成 c# 类。
请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org"
xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays ">
<soapenv:Header/>
<soapenv:Body>
<tem:request>
<tem:id>1</tem:id>
<tem:list>
<arr:string>Item1</arr:string>
<arr:string>Item2</arr:string>
<arr:string>Item3</arr:string>
</tem:list>
</tem:request>
</soapenv:Body>
</soapenv:Envelope>
有人可以帮我吗? 谢谢
【问题讨论】:
-
您是否有要集成的服务的 WSDL(服务定义)文件?
-
不,只是请求。
-
请求是一个字符串而不是类。序列化产生一个字符串。您可以使用 doc.ToString() 从我的解决方案中获取字符串。
标签: c# xml web-services serialization