CodeIgniter xmlrpc请求格式
一般来说,我对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终使用了 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.