In your user interface plug-in module WAR bundle, locate the /war/src/main/webapp/META-INF/MANIFEST.MF file and add the following lines:
com.vmware.myService is the name of the service package you created.
In the WAR bundle, locate the /war/src/main/webapp/WEB-INF/spring/bundle-context.xml file. This file specifies the necessary service parameters for the Flex-to-Java framework on the vSphere Web Client application server. Inside the
<beans> element of the
bundle-context.xml file, create the service references as follows:
The <flex:message broker> and
<flex:remoting-destination> elements declare your service as a destination for Flex remote object invocation.
Example 11-4, on page 99, presents a sample ActionScript proxy class implementation. The sample proxy class extends the
com.vmware.flexutil.proxies.BaseProxy class that the vSphere Web Client provides.
You must set the Proxy constructor destination argument to the service ID that you imported in your plug-in module configuration files. In
Example: Example ActionScript Proxy Class, the proxy constructor sets the
destination parameter to the service ID
myService, as defined in the WAR bundle configuration file (
/war/src/main/webapp/WEB-INF/spring/bundle-context.xml).
In the proxy, you can call functions of the Java service by using the callService method. The
callService method is included in the package
com.vmware.flexutil.ServiceUtil. In
Example: Example ActionScript Proxy Class, the proxy class uses the
callService method to call the
echo method in the Java service.