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.
精彩评论