0

Is it possible to get a return value from asmx web service, i have this code:

[WebMethod(CacheDuration = 0)]
public System.Xml.XmlDocument Load_DOK(System.Xml.XmlDocument XmlDoc)   
  {
  }

The INPUT parameter is XML DOCUMENT, and return message has to be a formatted SOAP message, like this:

 soapEnvelop.LoadXml(@"<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><soap:Body><Response_status>0</Response_status><Description>SUCCESS</Description></soap:Body></soap:Envelope>");
return soapEnvelop;

This is a call with parameter passing to web service:

System.Xml.XmlDocument ReceivingXmlDoc = new System.Xml.XmlDocument();
 TestService.TestService ws_dok = new TEST.TestService.TestService();

 ws_dok.Load_DOK(SendingXmlDoc);

So is it possible to extract that return?

Thanks!

4

2 回答 2

0

这应该像这样简单:

XmlDocument receivingXmlDoc = ws_dok.Load_DOK(sendingXmlDoc);
于 2012-07-23T09:24:04.207 回答
0

是的,因为您已经声明了webmethod Load_DOK to return as XmlDocument

XmlDocument doc=  ws_dok.Load_DOK(SendingXmlDoc);
于 2012-07-23T09:25:21.633 回答