无法使用 c# 生成正确的 soap 响应描述

cant generate the right soap response description with c#

我已经构建了一个 .net C# 网络服务。 我的一种方法应该 return 一个带有搜索结果的 XML。

当我的方法 return 的 XML 文档类型是:

时,我现在正在获取我当前的 soap 描述
 SOAP 1.1
 The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

 POST /HARELCYBWS/HARELCYBWS.asmx HTTP/1.1
 Host: safemail-t.harel-ins.co.il
 Content-Type: text/xml; charset=utf-8
 Content-Length: length
 SOAPAction: "http://www.securenet.co.il/GetSafeActivitiesXML"

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <GetSafeActivitiesXML xmlns="http://www.securenet.co.il">
       <safename>string</safename>
       <days>int</days>
       <FileName>string</FileName>
     </GetSafeActivitiesXML>
   </soap:Body>
 </soap:Envelope>
 HTTP/1.1 200 OK
 Content-Type: text/xml; charset=utf-8
 Content-Length: length

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <GetSafeActivitiesXMLResponse xmlns="http://www.securenet.co.il">
       <GetSafeActivitiesXMLResult>xml</GetSafeActivitiesXMLResult>
     </GetSafeActivitiesXMLResponse>
   </soap:Body>
 </soap:Envelope>

我希望响应是这样的:

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <GetSafeActivitiesXMLResponse xmlns="http://www.securenet.co.il">
       <GetSafeActivitiesXMLResult>
 <results>
 <result>
       <safename>string</safename>
       <days>int</days>
       <username>string</username>
       <numberID>int</numberID>
       <comment>string</comment>
 </result>
 <result>
       <safename>string</safename>
       <days>int</days>
       <username>string</username>
       <numberID>int</numberID>
       <comment>string</comment>
 </result>
 <result>
       <safename>string</safename>
       <days>int</days>
       <username>string</username>
       <numberID>int</numberID>
       <comment>string</comment>
 </result>
 </results>
 </GetSafeActivitiesXMLResult>
     </GetSafeActivitiesXMLResponse>
   </soap:Body>
 </soap:Envelope>

我试着研究模式、序列化和所有其他东西,但我真的不知道我在那里做什么。 我是 xml 的新手,我不知道所有细节。

我能做什么?另外,XML文档是否正确 return 类型?

请帮忙,

谢谢。

大卫

return 类型是新的 class 类型,表示单个结果 class 的列表。 为我工作。