Bad_EncodingError

Questions regarding the use of the Java SDK for Server or Client development or integration into customer products ...

Moderator: uasdkjava

Post Reply
saala
Full Member
Full Member
Posts: 9
Joined: 27 Feb 2012, 13:41

Bad_EncodingError

Post by saala »

Hello,
I receive an exceptin if I try to connect to a IBH Link UA Server.

Code: Select all

Exception in thread "main" com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://10.4.144.131:48010  ServiceResult=Bad_EncodingError (0x80060000) "Encoding halted because of invalid data in the objects being serialized."
	at com.prosysopc.ua.client.UaClient.discoverEndpoints(Unknown Source)
	at com.prosysopc.ua.client.UaClient.k(Unknown Source)
	at com.prosysopc.ua.client.UaClient.p(Unknown Source)
	at com.prosysopc.ua.client.UaClient.connect(Unknown Source)
	at com.schott.indit.test.OpcUaClient.main(OpcUaClient.java:21)
Caused by: org.opcfoundation.ua.common.ServiceResultException: Bad_EncodingError (0x80060000) "Encoding halted because of invalid data in the objects being serialized."
	at org.opcfoundation.ua.transport.tcp.io.TcpConnection$ReadThread.run(Unknown Source)
My simple code is just

Code: Select all

		UaClient client = Misc.createUaClient("opc.tcp://10.4.144.131:48010", null, null, 10000);
		client.connect();
		client.disconnect();

I tried it with diffrent versions of the OPC UA SDK up to 2.1.0-436 (Evaluation), JRE7 and JRE8.
But it is possible to connect to the IBH OPC server using your tool UaExpert (I use very old version 1.01.329.0.175)

Any idea

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

Re: Bad_EncodingError

Post by Support Team »

Hello,

There is not much information so it is hard to say. It probably does not matter, but it would be nice to know what the Misc.cre... method does. Anyway that error indicates that something could not be encoded into binary before sending it. It could happen on either side of the communication.

Options:
- Turn stack logging to DEBUG or TRACE level
- Check server logs
- Check with wireshark that is the error on responses (if the error is on client side then most likely the request is not even sent)

Best regards
Support Team

saala
Full Member
Full Member
Posts: 9
Joined: 27 Feb 2012, 13:41

Re: Bad_EncodingError

Post by saala »

Hello,

sorry, I forgot to say that I have removed all certifacte/UserIdentity code so that the 'program' is just

Code: Select all

com.prosysopc.ua.client.UaClient client = new UaClient("opc.tcp://10.4.144.131:48010");
client.connect();
client.disconnect();

wich throws the exception at the line clinet.connect();

Code: Select all

xception in thread "main" com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://10.4.144.131:48010  ServiceResult=Bad_EncodingError (0x80060000) "Encoding halted because of invalid data in the objects being serialized."
	at com.prosysopc.ua.client.UaClient.discoverEndpoints(Unknown Source)
	at com.prosysopc.ua.client.UaClient.k(Unknown Source)
	at com.prosysopc.ua.client.UaClient.p(Unknown Source)
	at com.prosysopc.ua.client.UaClient.connect(Unknown Source)
	at com.schott.indit.test.OpcUaClient.main(OpcUaClient.java:35)
Caused by: org.opcfoundation.ua.common.ServiceResultException: Bad_EncodingError (0x80060000) "Encoding halted because of invalid data in the objects being serialized."
	at org.opcfoundation.ua.transport.tcp.io.TcpConnection$ReadThread.run(Unknown Source)

saala
Full Member
Full Member
Posts: 9
Joined: 27 Feb 2012, 13:41

Re: Bad_EncodingError

Post by saala »

Hello,

an update of the firmware of the embedded opc ua server solved the problem! Thx for your support!

Post Reply