如何从 Phonegap(iPhone 应用程序)调用 SOAP 服务 [英] How to call SOAP service from Phonegap (iPhone app)

查看:37
本文介绍了如何从 Phonegap(iPhone 应用程序)调用 SOAP 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 这个 SOAP 客户端 但它对我不起作用.请帮我.如何使用 Phonegap 发送和接收 XML SOAP?

Phonegap 是 HTML/JS/CSS 通常通过 XHR/Ajax 进行通信.最好使用jQuery Ajax 函数.您可以在此处获得详细信息.

例如:

Posting-XML-SOAP-Requests

AJAX-Requests-Between-jQuery

调用 SOAP 网络服务的简单 jQuery 客户端

如果您发现任何跨域问题(或在浏览器中工作而不适用于模拟器/设备),请参考以下步骤.

转到Resources 文件夹,您可以看到一个名为Cordova.plist 的文件.单击它,您可以看到 Root 元素.右键单击根目录,添加一行,将键设置为 ExternalHosts,类型为 Array.

展开项目,并将项目添加为 item0.给它输入 string 并输入值作为*".

不要忘记在更改后保存 Cordova.plist(只需使用 cmd+s).

I am trying to call a SOAP service using this SOAP client but it is not working for me. Please help me. How can I send and receive XML SOAP with Phonegap?

解决方案

Phonegap is HTML/JS/CSS commonly communicating via XHR/Ajax. It's better to use jQuery Ajax functions. You can get the details here.

Eg:

Posting-XML-SOAP-Requests

AJAX-Requests-Between-jQuery

Simple jQuery client to call a SOAP web service

If you find any cross-domain issues (or working in a browser and not working with simulator/device), please refer to the below steps.

Go to the Resources folder, you can see a file named Cordova.plist. Click on that and you can see the Root elements. Right click on the Root, add a row, set the key as ExternalHosts with type Array.

Expand the item, and add an item as item0. Give it type string and enter the value as '*'.

Don't forget to save the Cordova.plist after changes (just use cmd+s).

这篇关于如何从 Phonegap(iPhone 应用程序)调用 SOAP 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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