Page 1 of 1

Bad_EncodingError

Posted: 11 Aug 2015, 14:10
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

Re: Bad_EncodingError

Posted: 12 Aug 2015, 12:05
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

Re: Bad_EncodingError

Posted: 12 Aug 2015, 14:45
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)

Re: Bad_EncodingError

Posted: 12 Aug 2015, 16:15
by saala
Hello,

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