本文介绍了xml到wbxml转换,以便在iOS中进行activesync的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试构建将与MS-ActiveSync Exchange通信的应用程序。我被困在供应部分。我需要发送包含WBXML内容的HTTP请求。但是我找不到任何地方可以将xml转换为wbxml进行主动同步。

I have been trying to built an app which will communicate with MS-ActiveSync Exchange. I am stuck at the provisioning part. I need to send a post HTTP request with WBXML content in body. But I could not find anything anywhere to convert xml to wbxml for active sync.

有一些基于C的库,如wbxml2,但是我可以使用它们进行主动同步。如MS-Activesync Exchange文档中所述,库中没有提供代码页。请帮忙!!!

There are some C based libraries available like wbxml2, but can I use them for active sync. There are no code pages provided in the library as mentioned in MS-Activesync Exchange documentation. Please help!!!

推荐答案

使用libwbxml。该软件包具有xml2wbxml和wbxml2xml。包括代码页。

Use libwbxml. The package has xml2wbxml and wbxml2xml. Code pages are included.

另存为prov.xml:

save this as prov.xml:

<?xml version="1.0"?>
<!DOCTYPE ActiveSync PUBLIC "-//MICROSOFT//DTD ActiveSync//EN" "http://www.microsoft.com/">
<Provision xmlns="Provision:">
<Policies>
<Policy>
<PolicyType>MS-WAP-Provisioning-XML</PolicyType>
</Policy></Policies></Provision>

然后:

xml2wbxml -a prov.xml -o prov.wbxml

您可以将wbxml操作为文本。

You can manipulate wbxml as text.In https://code.google.com/p/tz-push/

在javascript中:

In javascript:

 prov.wbxml = string.fromCharCode(0x03,0x01,0x6A,0x00,0x00,0x0E,0x45,0x46,0x47,0x48,0x03,0x4D,0x53,0x2D,0x57,0x41,0x50,0x2D,0x50,0x72,0x6F,0x76,0x69,0x73,0x69,0x6F,0x6E,0x69,0x6E,0x67,0x2D,0x58,0x4D,0x4C,0x00,0x01,0x01,0x01,0x01)

这篇关于xml到wbxml转换,以便在iOS中进行activesync的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 20:38