【发布时间】:2019-05-06 23:53:37
【问题描述】:
我有一个来自第三方的请求数据,它是 XML 格式的。我想将这些数据从邮递员传递给 C#。
请求 XML 如下:
<n0:MassMatchQCResponseMsg xmlns:prx="urn:sap.com:proxy:TST:/1SAI/TASF64A312341D275609721:740" xmlns:n0="http://example.com/compxref/abctype">
<MassMatchDet>
<InputProductNumber>456141</InputProductNumber>
</MassMatchDet>
</n0:MassMatchQCResponseMsg>
在这里,如果我删除命名空间别名 n0 并发布 XML,它可以使用以下 C# 方法正常工作。
[HttpPost]
public IActionResult Post([FromBody]MassMatchQCResponseMsg value)
{
}
但使用 n0,它的显示状态为 500:Internal server error and failed。有人可以告诉我如何在 C# 中使用 Postman 的命名空间解析 xml。
【问题讨论】:
-
不确定,但might be this
标签: c# xml postman asp.net-core-webapi