Hello这是我的服务代码 - 我想读取客户端传递的XMl,但是在开始读取它的throw错误时 - 读取流时抛出异常。
[WebMethod]
public bool processEvent(Stream XMLDoc)
{
string logPath = string.Empty;
processEventResult result = new processEventResult();
try
{
logPath = ConfigurationManager.AppSettings["ServiceLogPath"];
using (StreamReader reader = new StreamReader(XMLDoc))
{
while (!reader.EndOfStream)
{
string xmlString = reader.ReadToEnd();
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(xmlString);
string returnValue = xDoc.OuterXml;
}
}
}
}
public interface IDMSService
{
[OperationContract(Action = "urn:ProcessEvent")]
[WebInvoke(Method = "POST", UriTemplate = "processEvent",BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml)]
processEventResult processEvent(Stream XMLDoc);
}