Skip to content

PMode.Leg[1].BusinessInfo.Service 'null' is unsupported #213

@ErrorCode-404

Description

@ErrorCode-404

Hello guys thank you for this awesome as4 library.

I maybe have encountered an problem which I don't know how to handle it.
First of all I am using this library to implement an as4 receiver with the bdew profile.
Therefore i have created an simple springboot project according to the given springboot peppol example but with bdew support.
On the other side I am using the bdew client project in this repo which sends messages to the spring boot as4 receiver.

After some required configs (keystore, message content) the client can send as4 messages to the receiver.
But the receiver checks the parsed message and pmode and I get the following error:

PMode.Leg[1].BusinessInfo.Service 'null' is unsupported
This comes from the BDEWCompatibilityValidator which does some validation.

...
  final PModeLegBusinessInformation aBusinessInfo = aPModeLeg.getBusinessInfo ();
      if (aBusinessInfo == null)
      {
        aErrorList.add (_createError (sFieldPrefix + "BusinessInfo is missing"));
      }
      else
      {
        final String sService = aBusinessInfo.getService ();
        if (sService == null || !BDEWPMode.containsService (sService))
        {
          aErrorList.add (_createError (sFieldPrefix + "BusinessInfo.Service '" + sService + "' is unsupported"));
        }

        final String sAction = aBusinessInfo.getAction ();
        if (sAction == null || !BDEWPMode.containsAction (sAction))
        {
          aErrorList.add (_createError (sFieldPrefix + "BusinessInfo.Action '" + sAction + "' is unsupported"));
        }
      }
...

After an inspection with the debugger it seems that the property serviceValue in the businessInfo is null which may be the cause of the error.

Bildschirmfoto 2024-01-29 um 14 59 56

After further inspection of the code I saw that there will be created a default pmode (BDEWPMode in this case)

...
@Nonnull
  public static PModeLegBusinessInformation generatePModeLegBusinessInformation ()
  {
    final String sService = null;
    final String sAction = CAS4.DEFAULT_ACTION_URL;
    final Long nPayloadProfileMaxKB = null;
    final String sMPCID = CAS4.DEFAULT_MPC_ID;
    return PModeLegBusinessInformation.create (sService, sAction, nPayloadProfileMaxKB, sMPCID);
  }
...

If you compare these defaults with the debugger output you can see that the values in the debugger are still the same.
I have expected that the values like serviceValue will be exactly that what the client has send (e.g. "https://www.bdew.de/as4/communication/services/MP") but that is not the case.

Does the library does not extract those information or do I have an error in my thinking?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions