Systems, Applications, and Products (SAP) for data processing is an industry leading enterprise software solution that is widely used among product and process oriented enterprises for finance, operations, HR and many other aspects of a business. SAP ERP solutions provide reliable and efficient platforms to build and integrate enterprise or business-wide data and information systems with ease.
...
- Download and install WSO2 ESB by following the instruction in Installation Guide.
Download the sapidoc3.jar
and sapjco3.jar
middleware libraries from the SAP support portal and copy those libraries to the <ESB_HOME>/repository/components/lib
directory.
Info |
---|
|
You need to have SAP login credentials to access the SAP support portal. |
Download the native SAP JCo library and copy it to the system path. You need to select the system path applicable to your operating system as described below.
Linux 32-bit | Copy the Linux native SAP jcolibrary libsapjco3.so to <JDK_HOME>/jre/lib/i386/server . |
Linux 64-bit | Copy the Linux native SAP jcolibrary libsapjco3.so to <JDK_HOME>/jre/lib/amd64 . |
Windows | Copy the Windows native SAP jcolibrary sapjco3.dll to <WINDOWS_HOME>/system32 . |
Create a directory named sap
in the <ESB_HOME>/repository/conf/
directory and provide access rights to read the properties files you will save in it later.
Copy the following SAP endpoint properties files to the <ESB_HOME>/repository/conf/sap
directory. You need to have two properties files, one at the server-end and the other at the client-end to communicate with an external SAP endpoint using IDoc or BAPI.
Info |
This directory does not exist by default.ASAPsystem administrator has to create the directory and provide access rights so that you can read the properties files saved in the directory-end and the other at the client-end to communicate with an external SAP endpoint using IDoc or BAPI.
*.dest
: This is where we store SAP endpoint parameters when WSO2 ESB is configured as a client to an external SAP endpoint. *.server
: This is where we store SAP endpoint parameters when WSO2 ESB is configured as a server to an external SAP endpoint.
For details on creating the properties files and defining the relevant properties, see Setting up the Client Configuration File and Setting up the Server Configuration File.- Start the ESB using the
-Djava.library.path
switch to specify the location of your SAP jco library.
For example ./wso2server.sh -Djava.library.path=/usr/lib/jvm/jre1.7.0/lib/i386/server/
Anchor |
---|
| SetupClientPropertyFiles |
---|
| SetupClientPropertyFiles |
---|
|
...
Localtabgroup |
---|
Localtab |
---|
title | Configure with IDoc adapter |
---|
| WSO2 SAP adapter can be used with IDoc, which is a synchronous interface used when exchanging data with the SAP system. WSO2 ESB can be configured for Sending IDocs or Receiving IDocs when using the SAP adapter. Sending IDocsFollow the instructions below to configure WSO2 ESB as an IDoc client using the SAP adapter. Uncomment the following line in <ESB_HOME>/repository/conf/axis2/axis2.xml file to enable the IDoc transport sender on axis2 core. Code Block |
---|
| <transportSender name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportSender"/> |
Create IDocSender proxy service with the following configuration: Code Block |
---|
| <proxy xmlns=http://ws.apache.org/ns/synapse
name="IDocSender"
transports="http"
startOnLoad="true"
trace="enable"
statistics="enable">
<target>
<inSequence>
<log level="full"/>
<send>
<endpoint name="sapidocendpoint">
<address uri="idoc:/SAPSYS"/>
</endpoint>
</send>
</inSequence>
<outSequence/>
</target>
<parameter name="serviceType">proxy</parameter>
<description/>
</proxy> |
Info |
---|
- The SAP endpoint client properties file
SAPSYS.dest should be in <ESB_HOME>/repository/conf/sap folder. - Additional axis2 level sender parameters that can be defined in the axis2 core are listed in SAP Transport Sender Parameters.
|
You can now send IDocs using the configured WSO2 SAP adapter.
Anchor |
---|
| ReceivingIDocs |
---|
| ReceivingIDocs |
---|
|
Receiving IDocsFollow the instructions below to configure WSO2 ESB as an IDoc server using the SAP adapter. Uncomment the following line in <ESB_HOME>/repository/conf/axis2/axis2.xml file to enable IDoc transport receiver in axis2 core. Code Block |
---|
| <transportReceiver name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportListener"/> |
- Ensure the server configuration file
SAPSYS.server is available in <ESB_HOME>/repository/conf/sap folder.
Start the ESB using the -Djava.library.path switch to specify the location of your SAP jco library. For example sh wso2server.sh -Djava.library.path=/usr/lib/jvm/jre1.7.0/lib/i386/server/ Create the IDocReceiver proxy service with the following configuration: Code Block |
---|
| <proxy xmlns=http://ws.apache.org/ns/synapse
name="IDocReceiver"
transports="idoc"
statistics="enable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<drop/>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
<parameter name="transport.sap.enableTIDHandler">enabled</parameter>
<parameter name="transport.sap.serverName">SAPSYS</parameter>
<description/>
</proxy> |
Info |
---|
- The SAP endpoint server properties file
SAPSYS.server should be in <ESB_HOME>/repository/conf/sap folder. - Additional proxy level listener parameters that can be defined in the proxy configuration are listed in Proxy Service Listener Parameters.
|
Once the proxy service configuration is saved, WSO2 SAP adapter is now ready to receive IDoc messsages.
|
Localtab |
---|
title | Configure with BAPI adapter |
---|
| WSO2 SAP adapter so that it can be used with BAPI, which is a synchronous interface used when exchanging data with the SAP system. WSO2 ESB can be configured for Sending BAPIs or Receiving BAPIs when using the SAP adapter. Sending BAPIsFollow the instructions below to configure WSO2 ESB as a BAPI client using the SAP adapter. Uncomment the following line in <ESB_HOME>/repository/conf/axis2/axis2.xml file to enable the BAPI transport sender in axis2 core. Code Block |
---|
| <transportSender name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportSender"/> |
- Start the ESB using the
-Djava.library.path switch to specify the location of your SAP jco library. For example sh wso2server.sh -Djava.library.path=/usr/lib/jvm/jre1.7.0/lib/i386/server
Create the BAPISender proxy service with the following configuration: Code Block |
---|
| <proxy xmlns="http://ws.apache.org/ns/synapse"
name="BAPISender"
transports="bapi"
startOnLoad="true"
trace="disable">
<target>
<inSequence>
<send>
<endpoint name="sap_bapi_endpoint">
<address uri="bapi:/SAPSYS"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
</proxy> |
Info |
---|
- The SAP endpoint client properties file
SAPSYS.dest should be in <ESB_HOME>/repository/conf/sap folder. - Additional axis2 level sender parameters that can be defined in the axis2 core are listed in SAP Transport Sender Parameters.
|
Anchor |
---|
| ReceivingBAPI |
---|
| ReceivingBAPI |
---|
|
Receiving BAPIsFollow the instructions below to configure WSO2 ESB as a BAPI server using the SAP adapter. Enable the BAPI sender and listener in Uncomment the following line in <ESB_HOME>/repository/conf/axis2/axis2.xml by uncommenting the following lines of code: file to enable the BAPI transport listener in axis2 core. Code Block |
---|
| <transportSender name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportSender"/>
...
<transportReceiver name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportListener"/> |
- Start the ESB using the
-Djava.library.path switch to specify the location of your SAP jco library. For example sh wso2server.sh -Djava.library.path=/usr/lib/jvm/jre1.7.0/lib/i386/server
Create the BAPIReceiver proxy service with the following configuration: Code Block |
---|
| <proxy xmlns=http://ws.apache.org/ns/synapse
name="BAPIReceiver"
transports="bapi"
statistics="enable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<drop/>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
<parameter name="transport.sap.enableTIDHandler">enabled</parameter>
<parameter name="transport.sap.serverName">SAPSYS</parameter>
<description/>
</proxy> |
Info |
---|
- The SAP endpoint server properties file
SAPSYS.server should be in <ESB_HOME>/repository/conf/sap folder. - Additional proxy level listener parameters that can be defined in the proxy configuration are listed in Proxy Service Listener Parameters.
|
|
|
...
Following are descriptions of the SAP client properties that can be defined in the message context with axis2-client scope when using WSO2 ESB as a SAP client to send messages. These properties can be added in <ESB_HOME>/repository/conf/axis2/axis-client.xml file:
Property | Description |
---|
transport.sap.xmlMapper | The key of custom IDOC XML mapper to use. This key should be defined in the transport.sap. customXMLMappers parameter. If no key is specified the default IDoc XML mapper will be used. |
transport.sap. xmlParserOptions | The options for the default IDoc XML parser to be used in the default IDoc XML mapper. Multiple options can be combined using the bitwise OR "|" operator. The possible parser options are as follows: PARSE_ACCEPT_ONLY_XMLVERSION_10 3328 PARSE_ACCEPT_ONLY_XMLVERSION_11 2816 PARSE_ACCEPT_ONLY_XMLVERSIONS_10_TO_11 2304 PARSE_IGNORE_INVALID_CHAR_ERRORS 4 PARSE_IGNORE_UNKNOWN_FIELDS 2 PARSE_REFUSE_UNKNOWN_XMLVERSION 256 PARSE_REFUSE_XMLVERSION_10 512 PARSE_REFUSE_XMLVERSION_11 1024 PARSE_WITH_FIELD_VALUE_CHECKING 1 PARSE_WITH_IGNORE_UNKNOWN_FIELDS 2 PARSE_WITHOUT_FIELD_DATATYPE_CHECKING 8 |
...
Following are descriptions of the proxy level listener parameters that can be defined in a proxy configuration when using WSO2 ESB as a SAP server:
Parameter | Description |
---|
transport.sap.serverName | The name of the server containing the JCO server configuration. |
transport.sap. enableErrorListener | Set this to enable the default error listener. If this is used together with the transport.sap. customErrorListener parameter, the custom error listener will be used. |
transport.sap. enableTIDHandler | Set this to enable the transaction handler to handle transactions that are received from a SAP system. Transactional applications must provide a custom implementation using the transport.sap. customTIDHandler parameter. |
transport.sap. customTIDHandler | The fully qualified class name for the custom TID handler implementing JCoServerTIDHandler . |
transport.sap.connections | The number of registered connections managed by the server instance. The default value is 1 and the maximum value is 100 . |
transport.sap. customErrorListener | The fully qualified class name for the custom error listener implementing JCoServerErrorListener . |
transport.sap. customExceptionListener | The fully qualified class name for the custom exception listener implementing JCoServerExceptionListener . |
...
Troubleshooting
Given below are general troubleshooting guidelines.
...