Weitere ähnliche Inhalte
Ähnlich wie iPhone meets SOA - 06/2008
Ähnlich wie iPhone meets SOA - 06/2008 (20)
Mehr von Roland Tritsch (14)
iPhone meets SOA - 06/2008
- 1. Use FUSE to accelerate
iPhone Web Development
FUSE Master Class Series
Roland Tritsch
Director Services EMEA
roland.tritsch@iona.com 1
- 2. Introduction
This session will show you how to use FUSE to access SOAP/
HTTP WebServices from the iPhone
The code we are using in this session is available from the
IONA FUSE demo/download area open.iona.com
The main target audience for this session are Architects and
Developers that want to build iPhone applications that
integrate with the web
2
© 2008 IONA Technologies
- 3. Agenda
Why is this important/relevant?
Understanding the solution
Show the code - before and after
Understanding the demo!
The service interface
The client side implementation
The Software Development Environment
Summary
3
© 2008 IONA Technologies
- 4. Why is this important/relevant?
With the new iPhone SDK you can implement applications
using Objective-C or AJAX (XHTML, JavaScript, CSS)
The AJAX environment is quite powerful, but writing all the
code to send/receive (marshal/unmarshal) data using
XmlHttpRequest is extremly tedious and errorprone
How cool would it be, if you could use a wsdl2js or java2js
compiler to generate a complete SOAP/HTTP client side stack
for a given service and invoke on the operations of the service
with a simple request-response interface?
Hint: This stack would obviously still use XmlHttpRequest under the
hood, but this would not bother you anymore. Plus all of the
marshaling code is generated.
4
© 2008 IONA Technologies
- 5. The Service Interface
<...>
<wsdl:operation name="sayHi">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="sayHiRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHiResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<...>
5
© 2008 IONA Technologies
- 6. “Before” code
function onClickSayHi() {
var xmlHttpRequest = GetXmlHttpRequestObject();
// setup anonymous callback function to deal with response
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState != 4) return;
// LOTS of unmarshaling code goes here
}
// LOTS of marshaling code goes here
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
6
© 2008 IONA Technologies
- 7. “After” code :)
function onSuccess(response) {
var text = response.getResponseType();
}
function onError(error) {
alert(error);
}
function onClickSayHi() {
var service = GetGreeterService();
service.sayHi(onSuccess, onError);
}
7
© 2008 IONA Technologies
- 8. How to generate the code
Use wsdl2js or java2js to generate the code upfront
OR (even better) use the ...?js URL handler to generate the
javascript on the fly
WANNA SEE ???
8
© 2008 IONA Technologies
- 9. Demo
9
© 2008 IONA Technologies
- 10. Demo
© 2008 IONA Technologies0
1
- 11. Demo
© 2008 IONA Technologies1
1
- 12. Demo
© 2008 IONA Technologies2
1
- 13. The Software Development Environment
You can use what ever you want to develop the GUI
Dashcode, Eclipse, GWTK, EMACS :)
Latest version of Apache CXF
Build it from the TRUNK or use one of the nightly builds
Or download the next version of FUSE that will become available mid
of May.
iPhone simulator
Use either the one that comes with the iPhone SDK or (if you are still
on 10.4) the iPhoney simulator
Windows users can download Safari 3 for Windows
Debugging
Dashcode, Drosera, (Firebug)
© 2008 IONA Technologies3
1
- 14. Summary
We have shown you some powerful JavaScript generation
capabilities which can accelerate your Web-Development
efforts dramatically
This is especially relevant, if you want to write Web-
Applications for the iPhone
Check it out :)
The latest version of Apache CXF supports it right now (2.1)
A supported version of the feature will become available through the
FUSE Service Framework release in May 2008
The demo code that we used in this session is available on
open.iona.com
© 2008 IONA Technologies4
1
- 15. Resources
Download FUSE: http://open.iona.com/downloads
Apache CXF: http://incubator.apache.org/cxf/
iPhoney: http://www.marketcircle.com/iphoney/
Apple SDK: http://developer.apple.com/iphone/program/
Any questions?
EMail me: roland.tritsch@iona.com
© 2008 IONA Technologies5
1
- 16. What next?
Join the community at
open.iona.com
Learn about IONA’s
training, consultancy &
support offerings
© 2008 IONA Technologies6
1
- 17. Use FUSE to accelerate
iPhone Web Development
FUSE Master Class Series
Roland Tritsch
Director Services EMEA
roland.tritsch@iona.com 17