CONSUMING A WEB SERVICE IN YOUR iOS APPLICATION USING SOAP
Now you're ready to tackle the exciting task of consuming a Web service in your iOS application! In the following Try It Out, you learn how to communicate with the Web service using the SOAP method.
TRY IT OUT: Consuming Web Services Using SOAP
- Using Xcode, create a Single View Application (iPhone) project and name it WebServices. Use the project name as the Class Prefix and ensure that you have the Use Automatic Reference Counting option unchecked.
- Select the WebServicesViewController.xib file to edit it in Interface Builder.
- Populate the View window with the views as follows (see also Figure 16-3):
- Label (name it Enter amount to convert)
- Text Field
- Round Rect Button (name it Convert)
- In Xcode, edit the WebServicesViewController.h file by adding the following bold statements:
@interface WebServicesViewController : UIViewController
IBOutlet UITextField *txtAmount;
@property (nonatomic, retain) UITextField *txtAmount;
- In Interface Builder, perform the following actions:
- Control-click the File's Owner item and drag it over the TextField. ...