Show TOC Start of Content Area

Function documentation Java Proxies as Sender  Locate the document in its SAP Library structure

Use

You want to send messages from a Java EE application to the Integration Server.

Integration

You must deploy the proxy beans and proxy classes generated by Java proxy generation together with the application program.

More information: Generate Java Proxies for XI 3.0 Compatible Service Interfaces

To do so, include them in the same EAR file that contains the classes of your application. However, the generated classes are dependent on the classes of the Java proxy framework, which must be installed on the Java EE server. To declare this dependency for EJB applications, include the following packages in the descriptor file application-j2ee-engine.xml:

com.sap.aii.proxy.svc
com.sap.aii.af.sdk.lib
com.sap.xi.util.misc
com.sap.guid

The above dependencies are of type weak and have the provider name sap.com.

Note

The AS Java library com.sap.aii.proxy.runtime is replaced by the service com.sap.aii.proxy.svc.

Prerequisites

In the Enterprise Services Repository, you have created an outbound service interface with interface pattern stateless (XI 3.0 compatible) for describing caller interfaces. Using Java proxy generation, you have created consumer proxy beans and consumer proxy classes, which you include in your application.

Features

General

Java proxy generation generates all the Java classes necessary for a consumer proxy: the EJB 2.0 bean class, home and remoteinterfaces, local home and local interfaces, as well as Java classes for the data types used.

The consumer proxy bean for the outbound service interface is a stateless session bean. To send messages and use other services, you use normal EJB calls: First, localize the bean by using JNDI. Next, create a home or local homeinterface and then create a remote or local interface for the bean. Finally, call the method for the remote or localinterface. The bean then calls the corresponding method of the consumer proxy class. This method generates a message from the call and forwards it to the Integration Server by using the messaging system:

This graphic is explained in the accompanying text

To use further services of the Java proxy runtime, use the MessageSpecifier interface. For example, this interface enables you to send attachments together with the message.

More information: MessageSpecifier Interface

Co-Located Beans

Since the proxy runtime supports EJB 2.0, you can use co-located beans. These beans are deployed in the same EJB container system and executed on the same Java VM. The advantage of co-located beans is that they improve performance.

You access co-located beans by using the local and local homeinterfaces, which are generated in addition to the home and remoteinterfaces from EJB1.1. To differentiate co-located beans from remote beans, use the prefix “localejbs/”.

Indirect Outbound Communication

In this case the standalone application calls a proxy bean on the SAP AS Java. The Java EE server only finds the called proxy bean if the file jndi.properties can be found in the class path and is configured correspondingly. The file enables the application to locate the proxy bean by using the naming service of the Java EE server. It must be located in the work directory of the standalone application and contain the following entries:

java.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl

java.naming.provider.url=<host>:<p4port>

         (or java.naming.provider.url=localhost:50004)

java.naming.security.principal=Administrator

java.naming.security.credentials=<Password>

Alternatively, you can also set these attributes directly in your application program.

Otherwise there are no differences to programming against a proxy bean from a Java EE application.

 

 

 

 

End of Content Area