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
stanleylee
Full Member
Full Member
Posts: 7
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
https://drive.google.com/file/d/1GqWqUCnrnFbdnBIgrMWqVy2m3-9zp_Ag/view?usp=drive_link

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);
and
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).
https://drive.google.com/file/d/1wyfLU2tRvDM_T5gmo85BEMAzmmuCmN0g/view?usp=sharing

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

Thanks.

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

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

Post by Support Team »

Hi,

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