11:07, EET
March 16, 2017
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!
15:15, EET
April 3, 2012
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.
11:27, EET
March 16, 2017
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
14:08, EET
April 3, 2012
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.
Most Users Ever Online: 1919
Currently Online:
14 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 736
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6450
Newest Members:
kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, ThomassnismModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1