views:

3309

answers:

5

Hi,

I need great video tutorial for using webservices in iphone objective c.My requirment is already values are in webservice, so just i want to access the webservice and validate username and password and return back to true or false get value display on the iphone.

If anybody have idea about tutorial please help me out..

+2  A: 

This might help.

Also, this link.

Zaki
+2  A: 

The by far easiest way to consume a web service on an iPhone is to use Hessian. Implement the server in Java using the official Hessian distribution, or in .NET using HessianC#.

Let us assume you have defined the following interface for your web service, and implemented it as a HessianServlet (Just replace a HttpServlet):

public interface MyService {
  public String doWithStuff(String action, Object stuff);
}

It is just as easy on .NET.

On the client side use HessianKit, where you create proxies to the web service, and then use them just as if they where local object. First you must conbert the Java interface above to an Objective-C protocol.

@protocol MySertvice
-(NSString)do:(NSString*)action withStuff:(id)stuff;
@end

Then use it as a proxy, just as if it was a local object:

id<MyService> proxy = [CWHessianConnection proxyWithURL:serviceURL
                                               protocol:@protocol(MyService)];
NSLog(@"%@", [proxy do:@"Something" withStuff:arguments]);

Hessian in a binary web service protocol, meaning allot smaller payloads, which is good on a slow GSM connection. Hessian is also much easier to encode and decode, compared to XML and JSON, meaning your app can make calls and receive responses using less CPU, and memory for temporary objects.

PeyloW
is there any sample code, which uses Hessian API?
iPhoneDev
+1  A: 

iPhone on Rails is

an Objective-C port of Ruby on Rails' ActiveResource.

but it can be used as a wrapper to access any RESTful webservice. ObjC classes and objects correspond to ActiveRecord classes and objects (which correspond to data base tables and rows).

There's an introductory screencast over here.

Felixyz
A: 

how to call java webservice in objective c

jig
A: 

Try WSClient++ which will simply generate objective-c classes for your project and you can use it like normal objects in objective-c.

Akash Kava