iPhone meets SOA - 06/2008


Published on

1 Like
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

iPhone meets SOA - 06/2008

  1. 1. Use FUSE to accelerateiPhone Web DevelopmentFUSE Master Class SeriesRoland TritschDirector Services EMEAroland.tritsch@iona.com 1
  2. 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. 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. 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. 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. 6. “Before” codefunction 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. 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. 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. 9. Demo 9 © 2008 IONA Technologies
  10. 10. Demo © 2008 IONA Technologies0 1
  11. 11. Demo © 2008 IONA Technologies1 1
  12. 12. Demo © 2008 IONA Technologies2 1
  13. 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. 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. 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. 16. What next? Join the community at open.iona.com Learn about IONA’s training, consultancy & support offerings © 2008 IONA Technologies6 1
  17. 17. Use FUSE to accelerateiPhone Web DevelopmentFUSE Master Class SeriesRoland TritschDirector Services EMEAroland.tritsch@iona.com 17
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.