Build Multiple Web Service-Consuming Flex Applications Using Proxy Classes

  • by Sandesh Darne, Mobility Practice Head, L&T Infotech
  • October 30, 2009
Proxy classes for use in Web applications can be automatically generated by ActionScript, an SAP NetWeaver plug-in, integrated with Adobe Flex Builder 2 or via a wizard in Adobe Flex Builder 3. How the proxy classes are created isn’t as important as your understanding the proxy class structure. Learn how to deal with generated proxy classes to develop code in Flex applications that consume enterprise services.
Key Concept

A proxy class shields the client from the complexity involved in invoking each Web service in an enterprise service. A proxy class contains all the methods and objects that a Web service exposes. These methods handle the marshalling of the parameters into SOAP, sending the SOAP request over HTTP, receiving the response from the Web service, and un-marshalling the return value. The proxy class allows the client program to call a Web service as if the Web service were a local component.

With service-oriented architecture (SOA), the traditional Web development era is changing dramatically to adopt Web services as a primary element of Web development. With mature development technologies such as SAP Web Dynpro for ABAP or Java and Adobe Flex, it is matter of some clicks and a few lines of codes to consume a simple Web service in a Web application. The picture changes as you integrate more sophisticated Web services or enterprise services (a combination of related Web services). Coding complexity increases as you relate and bind nested, complex structures of Web service elements, which is the typical case for an enterprise service.

One standard and proven development approach is integrating an enterprise service via a proxy class. Adobe Flex Builder 2 does not provide standard functionality for generating proxy classes and depends solely on the MXML Web service component that the SDK provides. Although Flex Builder 3 provides a wizard to generate proxy classes, I decided to use Flex Builder 2 and ActionScript to explain how the classes are generated and how you can modify them to develop Web applications that consume multiple Web services found in enterprise services.

What you learn here you can apply to the later versions of Flex Builder. You should have a basic understanding of enterprise Web services and beginner-level knowledge of Adobe Flex. If you are familiar with the SAP Web Dynpro development platform and the adaptive Web service model, you can quickly grasp the development technique I explain.

I will discuss the link between generated proxy classes of Web service operations, related messages, elements, and type definitions. I will also show you how to design and develop Web service consumption coding in Adobe Flex technology. I provide some ready-to-use code to get you productive quickly. This source code can act as a template for Web service integration into an Adobe Flex Web application that uses proxy class implementation.

Sandesh Darne

Sandesh Darne is a senior lead for the Consulting ERP Practice at L&T Infotech, India. He leads a group of senior consultants whose primarily focus is on SAP upgrades and SAP usability consulting services. He also directs the SAP NetWeaver Portal and the SAP Center of Excellence, which focuses on excellent practices in organizations. He is certified in SAP NetWeaver Business Warehouse 3.5. He has also worked in the product development department of L&T Infotech where products such as ZoomUP, eALPS, and CodeReview were built and used as accelerators for SAP upgrade projects.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.