ServiceStack WS 上需要排序位置 XML 节点的意外行为 [英] Unexpected behaviour with requered ordering position XML node on ServiceStack WS

查看:66
本文介绍了ServiceStack WS 上需要排序位置 XML 节点的意外行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,ServiceStack 使用 .NET 的 Xml DataContractSerializer 来序列化/反序列化 XML,但是如果我们的 Web 服务 API 使用的不是 .NET 框架,我们会遇到一些麻烦.

Now as I know ServiceStack uses .NET's Xml DataContractSerializer to serialize/deserialize XML, but with it we have some truble in case when our webservice API used not .NET framework.

这篇文章中很好地描述了这个问题如果尝试简短描述问题:

This problem very good described in this post if try short describe of problem:

要求严格的节点顺序 XML 对于某些外部编号来说非常不舒服.网络系统.

Requirement of strict sequence of nodes XML is very uncomfortable for some external no. NET system.

有没有可能使用不同的serialize或者configure所使用的ServiceStack,让他没想到元素在一个死板的位置?

Is it possible to use a different serialize or configure the ServiceStack used, so that he did not expect the elements in a rigidly defined positions?

推荐答案

ServiceStack 使用 .NET 的 XML DataContract引擎盖下的串行器.除了底层 .NET 的框架实现所提供的内容之外,它不可自定义.

ServiceStack uses .NET's XML DataContract serializer under the hood. It is not customizable beyond what is offered by the underlying .NET's Framework implementation.

我已经在前面的问题中回答了如何使用自定义 XML 序列化程序覆盖 ServiceStack 的默认 XML 序列化:

I've answered how to override the ServiceStack's default XML Serialization with a custom XML Serializer in this earlier question:

https://stackoverflow.com/a/13498725/85785

这篇关于ServiceStack WS 上需要排序位置 XML 节点的意外行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆