Search This Blog

Wednesday, March 10, 2010

Java Proxy Generation in SAP XI

 
Using the Java proxy generation function, you can generate Java classes or Java proxy objects from the interface description in the Integration Repository. Using these objects, you can then implement sender and receiver applications in Java; the proxy objects establish the connection to the Integration Server by using the Java proxy runtime.

You can generate Java proxies for J2EE applications on the SAP Web AS. Proxy generation generates J2EE beans and proxy classes for this purpose. The generated beans satisfy the EJB 2.0 standard.

 
Java proxy generation is part of the Integration Builder and has the following functions:

·        Create an archive (as a Jar or Zip file) by using one or more message interfaces from the same software component version. The archive contains bean and proxy classes.

·        Open existing archives to regenerate proxies. Proxy generation knows the original message interfaces for which proxy objects are contained in the archive.
 

Selecting Message Interfaces

You can call Java proxy generation from the design maintenance screen of the Integration Builder in the following ways:

·        From the main menu, choose Tools ® Java Proxy Generation.

·        From the context menu, choose Java Proxy Generation... for message interfaces in the navigation tree.

The latter method has the advantage that the selected message interface and the corresponding software component version can be copied directly. You can only generate proxy classes for message interfaces and not for sub objects of message interfaces.
 

Creating New Archives and Changing Existing Archives

The first step when generating a Java proxy is to specify an archive (in Jar or Zip format). You have two alternatives:

·         You can create a new archive. If you select an archive that already exists here, it will be overwritten.

·         You can change an existing archive. Choose this option when you want to regenerate proxy objects. Java proxy generation recognizes which message interfaces already have proxies in the archive so that these proxies can be regenerated as well. You can only regenerate proxy classes for the entire message interface.

 

Activities

       1.      Navigate to the design maintenance screen of the Integration Builder.

       2.      Start proxy generation as described above and follow the instructions.

The resulting archive contains the corresponding Java source text files of the Java proxy objects.

Tips

·        Technically speaking, a Jar archive corresponds to a Zip archive. You can view the contents of the generated Jar archive in Windows, using WinZip, for example. Using the jar command, you can display the contents by using jar -tf <Filename> and read the contents by using jar -xf <Filename>.

·        To gain an overview of the generated classes, generate it with javadoc HTML documentation.
 

No comments:

Post a Comment