Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
What is the default
January 22, 2020
11:07, EET
Avatar
rocket science
Member
Members
Forum Posts: 76
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi,

we get an error: Bad_TcpMessageTooLarge (code=0x80800000, description=”The size of the message specified in the header is too large.”)

What I found is that the max response message size has to be set to a higher value using following method:

uaClient.setMaxResponseMessageSize((int maxResponseMessageSize))

What I wonder is, as I did not found an answer in the javadoc, what’s the ‘default’ value for the response message size?

Thank you!

January 23, 2020
15:15, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Hmm interesting.. do you know what SDK has been used to make the server?

However, the default _is_ mentioned in the javadocs:

Define the maximum size, in bytes, for the body of any response message from the server. Theserver should return Bad_ResponseTooLarge service fault if a response message exceeds thislimit.
Parameters:maxResponseMessageSize the maxResponseMessageSize to set, the value must be a positivevalue. Default is 0, which means that it is not used.

i.e. default is 0, thus our client doesn’t impose a limit by default. I guess a server might have their own limits in this case.

January 29, 2020
11:27, EET
Avatar
rocket science
Member
Members
Forum Posts: 76
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi,

thank you for the answer.

We found the problem – unfortunately we used the wrong port to connect to the OpcUa Server (Kepware).
Accidentally we used the port for another service instead of the port of the OpcUa Server.

In such a case it seems that the Prosys Client SDK returns ‘Bad_TcpMessageTooLarge’ which was a bit misleading, because as we saw in the wireshark recording the connection was aborted after the first ‘Hello’ message from the Prosys Client SDK. So we thaught that it might have to do something with the messageSIze, messageBuffer parameters.

We could reporduce it also by just creating a socket which returns anything else than a valid OpcUa protocol and connect to this using the SDK:

public void createSomeServer() throws Exception {
ServerSocket serverSocket = new ServerSocket(53531);
Socket clientSocket = serverSocket.accept();
BufferedReader input = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
byte inputValue = (byte) input.read();
while (inputValue != -1) {
System.out.println(“Value: ” +inputValue);
inputValue = (byte) input.read();
out.write(“Hi”);
out.flush();
}
out.write(“Hi!”);
out.flush();
while (true) {}
}

If you connect using ‘opc.tcp://127.0.0.1:53531/’ than the Prosys SDK response code will be Bad_TcpMessageTooLarge

January 29, 2020
14:08, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Thanks for the reproducing code.

However, in this case that is, well… I would say this is somewhat the expected result. You could also see something else e.g. Bad_ProtocolVersionUnsupported (or Bad_TcpMessageTypeInvalid, Bad_TcpInternalError) , but this depends entirely on the data returned from the socket.

The Hello/Acknowledge TCP “OPC UA Messages” are the very first handshake (if we ignore TCP level protocol internals and assume we have a full-duplex stream of bytes in our disposal). The returned bytes are interpreted as the Acknowledge message (we have some additional some sanitychecks). And in this case most likely the length based on the bytesequence (the first 4 bytes) was too large. IT would seem the same code is used for too short message, but OPC UA does not have a code for that. Maybe we should return something else. Or anyway we could maybe add a description to the exception.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 76

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 685

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6257

Newest Members:

Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 320, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1