如何从Phonegap调用SOAP服务(iPhone应用程序) [英] How to call SOAP service from Phonegap (iPhone app)
问题描述
我想使用此SOAP客户端来调用SOAP服务>但它不为我工作。请帮帮我。如何使用Phonegap发送和接收XML SOAP?
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是通常通过XHR / Ajax进行通信的HTML / JS / CSS。最好使用 jQuery Ajax 函数。您可以在此处查看详细信息。
Phonegap is HTML/JS/CSS commonly communicating via XHR/Ajax. It's better to use jQuery Ajax functions. You can get the details here.
例如:
如果您会发现任何跨网域问题(或在浏览器中工作,而不是使用模拟器/设备),请参阅以下步骤。
If you find any cross-domain issues (or working in a browser and not working with simulator/device), please refer to the below steps.
转到资源文件夹中,您可以看到名为 Cordova.plist 的文件。点击它,您可以看到根元素。右键单击根,添加一行,将键设置为 ExternalHosts 类型 Array 。
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.
项目,然后将项目添加为 item0 。给它类型字符串并输入值为'*'。
Expand the item, and add an item as item0. Give it type string and enter the value as '*'.
不要忘记在更改后保存Cordova.plist cmd + s)。
Don't forget to save the Cordova.plist after changes (just use cmd+s).
这篇关于如何从Phonegap调用SOAP服务(iPhone应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!