CodeIgniter xmlrpc请求格式

发布于 2024-12-10 02:28:55 字数 847 浏览 0 评论 0原文

一般来说,我对 CodeIgniter 和 Xmlrpc 很陌生,所以我有一个相当基本的问题。我希望向需要表单数据的 Web 服务发出请求

POST /LabelService/EwsLabelService.asmx/ChangePassPhraseXML HTTP/1.1
Host: www.envmgr.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
changePassPhraseRequestXML=<ChangePassPhraseRequest> ...
</ChangePassPhraseRequest>

,并且该 xml 块中的一些选项嵌套两层。

同时,在http://codeigniter.com/user_guide/libraries/xmlrpc.html,我只看到请求作为数组传递。这些是否会转换为正确类型的 xml?我只是嵌套大量数组吗?我真的会有(值,类型)对作为 xml 键值对的每一侧吗?

更清楚地说:如果我像 $request = 那样,它会起作用吗? 数组(数组(“ChangePassPhraseRequest”,'字符串')=>(数组(“”,'字符串')), array(array("RequesterID", 'string') => array("313325", 'string'))... 等

看起来像是文档告诉我的,但它也看起来太可怕了,难以置信。

I am new to CodeIgniter and Xmlrpc in general, so i have a fairly basic question. I wish to make a request to a web service that expects data of the form

POST /LabelService/EwsLabelService.asmx/ChangePassPhraseXML HTTP/1.1
Host: www.envmgr.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
changePassPhraseRequestXML=<ChangePassPhraseRequest> ...
</ChangePassPhraseRequest>

and some of the options that go in that chunk of xml are nested two layers deep.

Meanwhile, at http://codeigniter.com/user_guide/libraries/xmlrpc.html, I only see requests getting passed as arrays. Do these get converted into xml of the right kind? Do I just nest tons of arrays? Would I really have (value, type) pairs as each side of xml key value pairs?

To be more clear: will it work if I be like $request =
array(array("ChangePassPhraseRequest", 'string') => (array("", 'string')),
array(array("RequesterID", 'string') => array("313325", 'string'))... etc

that seems like what the docs are telling me, but it also seems too horrible to be true.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吻安 2024-12-17 02:28:55

最终使用了 REST API: http://codeigniter.com/forums/viewthread/73080/

它接受 simpleXML 对象形式的参数,这比纯文本 xml 或嵌套数组的墙要好得多。

Ended up using the REST API: http://codeigniter.com/forums/viewthread/73080/

It accepts arguments in the form of a simpleXML object, which is much nicer to construct than a wall of plaintext xml or nested arrays.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文