How to increase the MaxMessageSize by UA client C++ SDK

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
Full Member
Full Member
Posts: 6
Joined: 11 Dec 2017, 08:33

How to increase the MaxMessageSize by UA client C++ SDK

Post by stanleylee »

I encountered an error when exporting large XML files from the OPC UA client.
An abort packet sent from the OPC UA server was observed from Wireshark.
The error code is 0x80b90000, BadResponseTooLarge

I searched for the root cause and the answer is increasing the MaxMessageSize, hence I made the following modifications in my source code.
ret = UaPlatformLayer::init();
UaPlatformLayer::changeSerializerSettings(-1, -1, -1, -1, 33554432);
printf("nMaxMessageSize:%u\n\n", UaPlatformLayer::nMaxMessageSize());
to make sure my modification is effective.

I can see the size is modified on the console through UaPlatformLayer::nMaxMessageSize() but the value in the packet of the Hello message sent from the Client is still the same as the default (16MB).

Could anyone tell me how to modify the MaxMessageSize on the client side of C++ SDK?


User avatar
Support Team
Hero Member
Hero Member
Posts: 3112
Joined: 18 Mar 2011, 15:09

Re: How to increase the MaxMessageSize by UA client C++ SDK

Post by Support Team »


please consider that the "MaxXYZParameters" are negothiated between the two communication partners. The "increase" of internal stack parameters is always a two sided approach.

Whenever you reach such limits, you should consider if you use the OPC UA as intended. Transfering a file content as large ByteString (exceeding message size, encoder limits, etc.) or transfering a file, as a file object without any limitation in size.
Best regards
Unified Automation Support Team

Post Reply