Skip to Content
Beginning iOS 5 Application Development
book

Beginning iOS 5 Application Development

by Wei-Meng Lee
January 2012
Beginner content levelBeginner
655 pages
16h 35m
English
Wrox
Content preview from Beginning iOS 5 Application Development

BASICS OF CONSUMING XML WEB SERVICES

Before you create an Xcode project to consume a Web service, it is good to examine a real Web service to see the different ways you can consume it. My favorite example is to use an ASMX XML Web service created using .NET. For the purposes of this discussion, we'll look at a Web service called CurrencyConvertor, which enables you to convert one currency to another.

The CurrencyConvertor Web service is located at http://www.webservicex.net/currencyconvertor.asmx. If you use Safari to load this URL, you will see that it exposes one Web method: ConversionRate, as shown in Figure 16-1.

image

FIGURE 16-1

The ConversionRate method returns the result (the exchange rate between two specified currencies) as an XML string. Clicking the ConversionRate link reveals the page shown in Figure 16-2.

image

FIGURE 16-2

The important parts are the sections following the Test section shown on the page. They detail the various ways in which you can consume the Web service: SOAP, and optionally, HTTP GET and HTTP POST. In the .NET world, accessing the Web service is a pretty straightforward affair — Visual Studio provides a built-in tool to create a Web proxy service object for the Web service simply by downloading the WSDL document. For iOS development, you need to get your hands ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering iOS 12 Programming - Third Edition

Mastering iOS 12 Programming - Third Edition

Donny Wals
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9781118144251Purchase book