View source | Discuss this page | Page history | Printable version   

Module:SAP ECC SOAP Communication/Developers Guide/How To Import And Export iDocs


In this document is described how to use the SAP ECC SOAP Communication module for interchanging iDocs between Openbravo and a SAP Server.

Exporting IDocs

The first step to enable the IDoc exportation from Openbravo to SAP is to develop a consumer for the SOAP web service that exposes the operation to export the IDocs into SAP.

To define and configure this consumer, we need to develop a class that extends the SAPExportClient class. For example:

public class IDocExportClient extends SAPExportClient<IDocExportService> {
  public IDocExportClient(SOAPConfiguration configuration) {
  protected void export(IDocExportService service, Map<String, String> iDocsToExport) {
    // Call the service operation that exports the iDocs
        .forEach(iDoc -> service.invoke(iDoc.getKey(), iDoc.getValue()));
  protected SOAPClient<IDocExportService> getSOAPClient(SOAPConfiguration soapConfiguration) {
    IDocSOAPExporter consumer = new IDocSOAPExporter(getIDocExportServiceImpl());
    return consumer;
  private IDocExportService getIDocExportServiceImpl() {
    // return the implementation of the IDocExportService
  class IDocSOAPExporter extends SOAPClient<IDocExportService> {
    IDocSOAPExporter() {
      super(new IDocExportService().getPort());
    void configure(SOAPConfiguration soapConfiguration) {
      // Configure the client 
      // The SOAPConfiguration parameter can be used to get the AD configuration data
      Map<String, Object> requestData = new HashMap<>();
      requestData.put(BindingProvider.USERNAME_PROPERTY, soapConfiguration.getMyUserField());
      requestData.put(BindingProvider.PASSWORD_PROPERTY, soapConfiguration.getMyPassField());

Some notes about the previous code:

The second step consist of registering our SAPExportClient class into the Application Dictionary. This is done by creating a SOAP configuration into the Communication with SAP ECC Server window:


In the header:

In the SOAP Configuration tab:

Note the SOAP Configuration tab is the place to add additional configuration settings (like HTTP basic credentials). This can be done by adding new fields into this tab. The value of this new fields can be retrieved in the getSOAPClient method of our SAPExportClient as explained above.

Importing IDocs

For importing IDocs coming from SAP into Openbravo a SOAP web service is exposed by default at:



This web receives an IDoc that is processed asynchronously using the default SAP import process.

See here to find a guide that explains how SOAP web services can be consumed.

Retrieved from ""

This page has been accessed 1,187 times. This page was last modified on 1 August 2019, at 11:11. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.