Solved

PhoneGap and XML / cURL

Posted on 2013-02-01
3
555 Views
Last Modified: 2013-02-08
I'm trying to access our web service through a PhoneGap development but haven't been able to figure out how to start and hoping that someone can point me in the right directon

I can get the web service to return an XML structure by posting this command as one example:
curl -d "method=showUser&userPhoneNo=987654321" http://localhost:8080/WhyQ/WhyQAppServlet

Open in new window


and to get it from a web page I use PHP and this command:
$ch = curl_init("http://URL:8080/WhyQ/WhyQAppServlet?method=showUser&userPhoneNo=0987654321");

Open in new window


Now in PhoneGap I can't use PHP but have learnt from research I can use Javascript to achieve this ... but I can't figure out how to do it after several hours of reading incl trial / error...

I would be very greatful if someone can point me in the right direction with a code snippet illustrating what commands would work to have this data displayed in PhoneGap

After doing research I've realised there might be something more required for me to host on the server where the web service is located or is that not necessary ?

I have access to the web server the web service is running

Many thanks,
Markus
0
Comment
Question by:DanteAdmin
3 Comments
 
LVL 21

Accepted Solution

by:
Kim Walker earned 500 total points
Comment Utility
I am totally unfamiliar with PhoneGap so I can only make a suggestion here which is to search the internet for AJaX. AJaX stands for Asynchronous JavaScript and XML. In a nutshell you would use AJaX to send a request to a PHP script on the server which returns an XML structured set of data. Then you would use JavaScript on the client side to process that data into the web page. The entire process is much too complicated for this forum, but once you get familiar with the concept and begin to develop the process, you could post specific questions here for the experts to help you with.
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
To our fellow experts... Please see this other question before you devote a meaningful amount of time to this question.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28023561.html#a38867701
0
 

Author Comment

by:DanteAdmin
Comment Utility
Hi Ray_Paseur

I'm not sure what your grudge is against us but if you're annoyed for not being awarded points then I stand behind my last message to you, which was:

If you think I should've done it in a different way then I did please explain what you suggest I should have done ?

If none of the answers provide a solution to my question, would it not be misleading for others that are looking for a solution to a similar problem to Accept a Solution just because you want points ?

I closed that thread and linked to a question where the solution was posted.

Again, instead of trying to smudge our account, explain to me what you would've liked us to do different.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now