c# - 如何在 ASMX Web 服务上从客户端接收 XML?
问题描述
我有一个 Web 服务 (ASMX),我希望我的代码能够从 Web 服务访问原始 XML。我怎么做?
[WebMethod]
public sendAttachmentResponse sendAttachments(sendAttachmentRequest request)
{
/***********************************************************/
// somewhere around here I would like to be able to get the XML that was actually sent
// by the client, not the serialization of the "request" parameter
/************************************************************/
var response = new sendAttachmentResponse ();
response.header = new responseHeader();
try
{
using(var repo = new DB())
{
repo.SendAttachmentsRequest(request);
}
response.header.status = "OK";
}
catch(Exception ex)
{
response.header.status = "KO";
response.header.errorCode = ex.HResult.ToString();
response.header.errorDescription = ex.Message;
}
return response;
}
解决方案
推荐阅读
- sql - 将三个表连接在一起以获得一个值
- javascript - 如何使用 Ramda.js 在 Javascript 中动态插入二维数组
- linux - Access Parse Dashboard Over Https
- twitter-bootstrap - 如何更改 Bootswatch 主题的颜色?
- arrays - 将整数附加到数组(使用 express 和 pg-promise)
- delphi - 指向另一个过程变量
- c - 从 C 程序到 Gnuplot 的问题管道数据
- c++ - 在永远运行的深度优先搜索代码中找不到错误
- reactjs - React bootstrap 必须将每个自定义类标记为 !important
- numpy - 将 2D 高斯核分离为两个 1D 核