Database Reference
In-Depth Information
help. Just as there is wsdl2java to create Java bindings for SOAP, there's a tool called
WSDL2ObjC that will create all the classes to bind iOS applications. You can download
it from http://code.google.com/p/wsdl2objc/ , and unlike the other tools we've discussed
in this section, it's not a library but a Mac utility. When you download the tool and
run it, you are presented with a window with two text fields and a button ( Fig-
ure 4-4 ). You put a URI specification for a WSDL file in the first text field, the second
specifies the directory that you want your generated code to be placed into. When you
click the button, you get a directory full of files that you can add to your iOS project,
and use to call the web service.
Figure 4-4. Generating a SOAP binding using WSDL2ObjC
In this example, we're consuming another weather service, because we really care about
the weather here at BuggyWhipCo. An extra-humid day can ruin an entire batch of
lacquered buggy whips, you know! In any event, we have the WSDL URI for a SOAP-
based weather service, and we've used it to generate a whole bunch of files that support
the binding to the service. If you look in the directory you generated your files into,
you'll see something like this:
NSDate+ISO8601Parsing.h
NSDate+ISO8601Parsing.m
NSDate+ISO8601Unparsing.h
NSDate+ISO8601Unparsing.m
USAdditions.h
USAdditions.m
USGlobals.h
USGlobals.m
WeatherSvc.h
WeatherSvc.m
xsd.h
xsd.m
With the exception of the two WeatherSvc files, everything else is standard and common
to all SOAP web services you generate, and if you have more than one service you bind
to, you'll only need one copy of those files (if you generate all your services into the
same directory, this should happen automatically).
 
Search WWH ::




Custom Search