开发者

Post serialized to xml object to mvc action

i have 2 projects. First project send to 2-nd via http-post requests, as serialized to XML class instances.

Ex:

<?xml version="1.0" encoding="utf-16"?>
<MyObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&开发者_如何学运维gt;
<UserId>test user</UserId>
...

How can i recieve it in action of 2-nd project?

[HttpPost]
public ActionResult Index(MyObject id)
{ ...

or like string, and deserialize after?

Thanx.


I would try to refactor this to JSON POST call. But yes, you can send xml data as string and deserealize it on server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜