Giter Site home page Giter Site logo

enryuu2 / as2-peppol-servlet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phax/as2-peppol-servlet

0.0 1.0 0.0 144 KB

A standalone servlet that takes AS2 requests with OpenPEPPOL StandardBusinessDocuments and handles them via SPI

CSS 39.57% Java 60.43%

as2-peppol-servlet's Introduction

#as2-peppol-servlet

Build Status 

A stand alone servlet that takes AS2 requests with OpenPEPPOL StandardBusinessDocuments and handles them via SPI. This is not a self-contained package, but a good starting point for handling PEPPOL AS2 messages.

An example application that uses as2-peppol-servlet for receiving PEPPOL AS2 messages is my as2-peppol-server project. It may serve as a practical starting point.

This package depends on ph-commons, ph-sbdh, as2-lib and as2-servlet. This transitively includes Bouncy Castle (1.53) and javax.mail (1.5.4) among other libraries.

as2-peppol-servlet handles incoming AS2 messages, and parses them as OASIS Standard Business Documents (SBD). It does not contain extraction of the SBD content or even handling of the UBL content since the purpose of this project is reusability. For validating the SBD against PEPPOL rules, the project peppol-sbdh is available and for handling UBL 2.0 or 2.1 files you may have a look at my ph-ubl.

Since version 3.0.0 this project uses as2-servlet. Previously the servlet code was contained in this project but I decided to extract the generic part into a separate project for easier re-use.

This project is licensed under the Apache 2 License.

Versions <= 1.0.1 are compatible with ph-commons < 6.0. Versions >= 2.0.0 are compatible with ph-commons >= 6.0.

#Usage To use this project you have to do the following:

  1. Configure the AS2 servlet as specified in the as2-servlet docs
  2. The key store must contain your PEPPOL AP certificate and the alias of the only entry must be the CN-value of your certificate's subject (e.g. APP_1000000001).
  3. Inside your project create an SPI implementation of the com.helger.as2servlet.sbd.IAS2IncomingSBDHandlerSPI interface to handling incoming SBD documents.

##Add project via Maven Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>as2-peppol-servlet</artifactId>
  <version>3.0.0</version>
</dependency>

##AS2 Configuration file Additionally to the configuration file specified in as2-servlet an additional processor must be added:

<?xml version="1.0" encoding="utf-8"?>
<openas2>
  ...
    <!-- [required] Process incoming SBD documents -->
    <module classname="com.helger.peppol.as2servlet.AS2ServletSBDModule" />      
  </processor>
</openas2>

##SPI implementation

SPI stands for "Service provider interface" and is a Java standard feature to enable loose but typed coupling. Read more on SPI

A dummy SPI implementation is contained in the test code of this project. Additionally you need to create a file META-INF/services/com.helger.as2servlet.sbd.IAS2IncomingSBDHandlerSPI (in the src/main/resources/ folder when using Maven) which contains a single line referencing the implementation class. An example file is located in the test resources of this project.

Known issues

  • PEPPOL AS2 specs requires that duplicate incoming message IDs are handled specially, by ignoring multiple transmissions of the same message ID
  • The certificate check of the sender's certificate must be improved

My personal Coding Styleguide | On Twitter: @philiphelger

as2-peppol-servlet's People

Contributors

phax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.