This tutorial was contributed by Dave (AKA Clarke76) on the Forums.
WebSite: http://viium.com
-Main project on site is eDuo. A .Net app that connects to OWA Exchange and forwards to IMAP account. Free program for those who can’t use Active Sync
Â
Important Links:
[WebService] http://viium.com/WebService/HelloWorld.asmx
http://developer.apple.com/documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html
http://www.w3schools.com/soap/default.asp
-After creating our XML data / SOAPÂ request, we create a URLRequest. We add HTTP Header values, those values you read from the WebService.
-We set the HTTP Method to POST
-We set out HTTP Body to the xml file we created
-We then create our connection, using the request we just setup.
Â
Â
-Once the connection is setup and delegate is set to self, we need to setup out connection delegate methods.
-The first method just makes sure it can make a connection. If it can, we make sure we have no data in our Data set so we clear it.
-Second method is called when re receive any data. If we do receive data, we just append it to our data set.
-Third Method handles any errors and releases our data and connection if an error occurs.
-Fourth Method: We take the data and create a string for Logging reasons, then release the string.
-We check to make sure an instance of xmlParser does not exist, if it does we release it.
-Create a new instance of xmlParser, set the delegate to self, want to resolve external entities, and start our parsing.
-release our connection and Data
Â
Â
Now we need to our our delegate methods for NSXMLParser
First method we are check the start of elements. If our element equals “HelloResult” we set our BOOL to true. Â Second method records any data between an element if our BOOL is set to true. Â Third method checks for our closing element. Once found sets our greeting, releases our MutableString, and set our BOOL back to false.
Â
If you have any questions or comments, please leave them in the comments of this post. Â You can download the sample code here.





Workout of the Day
Pingback: WSDL .. iphone ? - iPhone Forum - alles over de Apple iPhone en iPhone 3G
Pingback: ParaSite | Uploading
Pingback: Web Services Tutorial
Pingback: JSON-RPC Bridge to XML Web Services and usage in Objective-C in iPhone | Alkim Gozen
Pingback: UITableview + SOAP - iPhone Forum - alles over de Apple iPhone, iPhone 3G en iPhone 3GS
Pingback: Tutorial about web service | DeveloperQuestion.com