C# C Webservice以XML形式返回整个SOAPBody

C# C Webservice以XML形式返回整个SOAPBody,c#,web-services,soap,C#,Web Services,Soap,我正在拼凑一个C Web服务,它从XML文件中读取预定义的SOAP响应。我们用它来模拟一个高效的web服务。XML文件包含直接指向子节点的节点。但是,我当前的代码向中添加了一个节点,从而导致格式错误 我得到的是: <soap:Body> <Security_AuthenticateResponse xmlns="http://xml.tempuri.com/"> <Security_AuthenticateReply xmlns="http://x

我正在拼凑一个C Web服务,它从XML文件中读取预定义的SOAP响应。我们用它来模拟一个高效的web服务。XML文件包含直接指向子节点的节点。但是,我当前的代码向中添加了一个节点,从而导致格式错误

我得到的是:

 <soap:Body>
   <Security_AuthenticateResponse xmlns="http://xml.tempuri.com/">
     <Security_AuthenticateReply xmlns="http://xml.tempuri.com/VLSSLR_06_1_1A">
       <processStatus>
       ...
       </processStatus>
     </Security_AuthenticateReply>
   </Security_AuthenticateReply>
 </soap:Body>

我希望得到一些指令,告诉C删除其中一个节点。作为替代方案,我想我必须提取所有子节点并返回它们。

只是尝试了返回列表的选项,这会导致出现错误,所以这不是一个选项。
 <soap:Body>
   <Security_AuthenticateReply xmlns="http://xml.tempuri.com/VLSSLR_06_1_1A">
     <processStatus>
     ...
     </processStatus>
   </Security_AuthenticateReply>
 </soap:Body>
   [SoapDocumentMethod(Action = "http://webservices.amadeus.com/1ASIWABOAAI/VLSSLQ_06_1_1A",
          RequestNamespace = "http://xml.amadeus.com/VLSSLQ_06_1_1A",
          RequestElementName = "Security_Authenticate",
          ResponseNamespace = "http://xml.amadeus.com/VLSSLR_06_1_1A",
          ResponseElementName = "Security_AuthenticateReply")]
   [WebMethod]
   [return: XmlAnyElement]
   [SoapHeader("sessionId", Direction = SoapHeaderDirection.Out)]
   public XmlDocument Security_Authenticate()
   {
      .. some file magic here ...
      XmlDocument rp = getFile("Security_AuthenticateReply.xml");
      return rp;
   }