Giter Club home page Giter Club logo

Comments (7)

AlexandruCiobanu avatar AlexandruCiobanu commented on June 11, 2024 1

As a temporary fix I did the following:

@Nullable
  public static Ebms3SignalMessage parseSignalMessage (@Nonnull @WillNotClose final AS4ResourceHelper aResHelper,
                                                       @Nonnull final byte [] aBytes) throws Phase4PeppolException
  {
    // Read response as XML
    Document aSoapDoc = DOMReader.readXMLDOM (aBytes);
    if (aSoapDoc == null || aSoapDoc.getDocumentElement () == null) {
      Session newSession = Session.getDefaultInstance(new Properties());
      InputStream inputStreamObj = new ByteArrayInputStream(aBytes);
      try {
        MimeMessage mimeMessageObj = new MimeMessage(newSession, inputStreamObj);
        String contentType = mimeMessageObj.getContentType();
        part = (String) mimeMessageObj.getContent();
        part = part.replaceAll("\\<\\?xml(.+?)\\?\\>", "").trim();
        part = part.substring(0, part.lastIndexOf('>')+1);
        aSoapDoc = DOMReader.readXMLDOM (part);
        if (aSoapDoc == null || aSoapDoc.getDocumentElement () == null) {
            throw new Phase4PeppolException("Failed to parse as XML");
        }
      } catch (MessagingException e) {
        throw new Phase4PeppolException("Failed to parse as XML", e);
      } catch (IOException e) {
        throw new Phase4PeppolException("Failed to parse as XML", e);
      }
    } else {
      part = new String(aBytes);
    }
....

from phase4.

phax avatar phax commented on June 11, 2024

Okay, so you found the setSignalMsgConsumer method in the builder. This is clearly a bug...

from phase4.

AlexandruCiobanu avatar AlexandruCiobanu commented on June 11, 2024

In this case is there anythig I could do? Also any way to process the response message, meaning decrypt and verify the actual inside payload?

from phase4.

phax avatar phax commented on June 11, 2024

Thanks for the taking the time to post this here. Let me see what I can do....

from phase4.

phax avatar phax commented on June 11, 2024

In the meantime I verified, that it is okay, to always use MIME encoding. I need to implement this accordingly

from phase4.

phax avatar phax commented on June 11, 2024

@AlexandruCiobanu do you have a test endpoint for me, where the SignalMessage comes as a MIME message? Thx

from phase4.

phax avatar phax commented on June 11, 2024

It should be fixed in the v0.9.7 release

from phase4.

Related Issues (20)

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.