Dec.Ebusiness.Message.Client 1.21.432

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Dec.Ebusiness.Message.Client --version 1.21.432
                    
NuGet\Install-Package Dec.Ebusiness.Message.Client -Version 1.21.432
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dec.Ebusiness.Message.Client" Version="1.21.432" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dec.Ebusiness.Message.Client" Version="1.21.432" />
                    
Directory.Packages.props
<PackageReference Include="Dec.Ebusiness.Message.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dec.Ebusiness.Message.Client --version 1.21.432
                    
#r "nuget: Dec.Ebusiness.Message.Client, 1.21.432"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dec.Ebusiness.Message.Client@1.21.432
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dec.Ebusiness.Message.Client&version=1.21.432
                    
Install as a Cake Addin
#tool nuget:?package=Dec.Ebusiness.Message.Client&version=1.21.432
                    
Install as a Cake Tool

BMDNL MessageService Client

For easy communication with BMDNL's MessageService.

About the project

The BMDNL MessageService Client is a .NET tool with which messages can be sent to the MessageService API of BMDNL in a simple way.

The MessageService is an API with which transaction messages can be exchanged. The API is based on the standard defined by the Ketenstandaard foundation: https://ketenstandaard.nl/

With the client you will:

  • Be able to place a delivery order.
  • Not having to deal with the underlying complexity of the Ketenstandaard.
  • Only have to fill in and use the fields that are necessary for BMDNL.
  • Be able to implement error handling in an easy way.

Using the client

Setup code

In order to be able to call the MessageService from the client, the account details and the correct environment (acceptance or production) must be passed on.

var client = new MessageServiceClient(
    "[your-username]", 
    "[your-password]",
    TargetEnvironment.Acceptance); // or TargetEnvironment.Production
                

Note: You can request the account details from the BMDNL development team.

The order request

Now you can compose the request for a delivery order by using the DeliveryOrder object.

var request = new DeliveryOrder();
request.IsOrderProposal = false;
request.References = new Sgbdnl.Ebusiness.Message.Client.Dto.OrderReferences
{
    CustomerOrderNumber = "TSTCLNT001",
};
request.RequestedDeliveryMoment = new DeliveryMoment
{
    AllowPartialDeliveries = true,
    OnCall = true,
    DeliveryDate = new Sgbdnl.Ebusiness.Message.Client.Dto.DeliveryDate
    {
        NotBeforeDate = DateTime.Now,
        NotAfterDate = DateTime.Now,
    },
};
request.Customer = new Sgbdnl.Ebusiness.Message.Client.Dto.Customer
{
    Gln = "9999999999999",
    OrganisationId = "[your customer number]",
};
request.Supplier = new Supplier
{
    Gln = "9999999999999",
};
request.DeliveryAddress = new Sgbdnl.Ebusiness.Message.Client.Dto.DeliveryAddress
{
    AddressName = "Naam van afleveradres",
    Address = new Sgbdnl.Ebusiness.Message.Client.Dto.Address
    {
        Street = "Magazijnstraat",
        HouseNumber = 4,
        City = "BEMMEL",
        PostalCode = "6681 LT",
        CountryCode = "NL",
    }
};
request.OrderLines = new List<SalesOrderLine>
{
    new SalesOrderLine
    {
        Product = new Sgbdnl.Ebusiness.Message.Client.Dto.Product
        {
            ProductNumber = "1000000",
        },
        Quantity = new Sgbdnl.Ebusiness.Message.Client.Dto.Quantity
        {
            Amount = 1,
        }
    },
};

Note: If you do not yet have your own GLN (Customer.Gln field), you can request one from the Ketenstandaard. The GLN of your supplier (Supplier.Gln field) can be obtained from the BMDNL team.

Post the delivery order

After setting up the order, you can send the request to the MessageService.

// Setup code
...

// Setting the request
var request = new DeliveryOrder();
...

// Post delivery order
var response = await client.PostDeliveryOrder(request);

// Handling the response
...

Note: When the order has been successfully processed, the MessageService client returns the order details in a SalesOrder response object.

Error handling

The client offers the possibility to easily interpret the handling of an invalid order, if you get an error back from the MessageService.

try
{
    ...
    var response = await client.PostDeliveryOrder(request);
    ...
}
catch (FaultException e)
{
    if (e.GetFaultDetails().ErrorCode.Equals("121")) // Faultcode 121 = Wrong Credentials
    {
        // Get more information about the error with e.GetFaultDetails().Message;
    }
    else
    {
        // Handle more error codes
    }
}

Error codes

Below is a list of the error codes that the MessageService can return.

Name ErrorCode Description
MissingAuthenticationData 120 Missing authentication data
WrongCredentials 121 Wrong credentials
FailedAuthorization 130 Authorization failed for an unknown reason, contact support for more information
FailedAuthorization 130 Authorization failed, you don't have the necessary clearance
FailedAuthorization 130 U bent niet gemachtigd voor deze organisatie.
InvalidApplicationId 140 Invalid application id
MissingApplicationId 141 Missing application id
UnknownMessageType 160 Unknown message type
UnknownMessageId 170 Unknown message id
MissingMessageId 171 Missing message id
UnknownMessageFormat 180 Unknown message format
MessageFormatNotAvailable 182 Message format not available
UnknownVersionId 190 Unkwown version id
MissingVersionId 191 Missing version id
VersionIdNotSupported 192 Version id not supported
UndefinedError 199 Undefined error
TestMessageNotSupported 901 Test message not supported
CompressedContentNotSupported 902 Compressed content not supported
WrongConfiguration 903 Wrong configuration
? 911 ?
MissingContent 990 Missing content
InvalidContent 991 The format of the message content is invalid
PartOfContentIsInvalid 992 There is no {0} in the message content or the format is invalid (where {0} is the field name)
PartOfContentIsInvalid 992 Ordertype not allowed
PartOfContentIsInvalid 992 Draft order indicator not allowed
PartOfContentIsInvalid 992 Delivery on demand indicator not allowed
PartOfContentIsInvalid 992 Backhauling must be allowed
PartOfContentIsInvalid 992 ScenarioTypeCode is not allowe
PartOfContentIsInvalid 992 Only one transportinstructiontype code is allowed
ErrorInContent 993 It is not allowed to order for the given global location number (GLN)
ErrorInContent 993 It is not possible to disallow a backorder
ErrorInContent 993 The order version inside of the message content is not allowed
EbusinessError 994 Post order error in E-Business Platform
EbusinessError 994 Unknown error
EbusinessError 994 Ongeldig klantnummer
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.48.0-alpha.11 114 8/8/2024
1.48.0-alpha.9 91 8/7/2024
1.48.0-alpha.7 87 8/7/2024
1.48.0-alpha.4 103 7/26/2024
1.47.0-alpha.2 93 7/23/2024
1.46.0-alpha.16 99 7/19/2024
1.21.432 134 1/12/2026
1.21.431 214 11/25/2025
1.21.430 211 1/21/2025
1.21.430-test.3 99 1/21/2025
1.21.429 212 12/2/2024
1.21.429-test.18 91 11/26/2024
1.21.429-test.17 93 11/22/2024
1.21.429-test.13 92 11/21/2024
1.21.429-test.12 90 11/21/2024
1.21.429-test.10 86 11/20/2024
1.21.429-test.9 85 11/20/2024
1.21.428 249 8/8/2024
1.21.427 223 7/23/2024
1.21.426 240 7/22/2024
Loading failed