I wrote this ASN.1 description
Demo-module DEFINITIONS ::= -- Module-name DEFINITIONS ::= BEGIN
BEGIN
ClientFirstRequest ::= SEQUENCE {
clientInt INTEGER
}
ServerFirstResponse ::= SEQUENCE {
serverInt INTEGER ,
serverString IA5String
}
ClientSecondRequest ::= SEQUENCE {
clientString IA5String
}
ServerSecondResponse ::= SEQUENCE {
serverResponse IA5String
}
END -- end of module, END required
I have a code who send an integer to a server , it work perfectly
DataOutputStream dos = new DataOutputStream(_socket.getOutputStream());
dos.writeInt(4);
But I tried to use the ASN.1 classes and i have a problem, I tried the following code, but I have an error in the setValue method
ClientFirstRequest h = new ClientFirstRequest();
h.setValue(4);
BerOutputStream bos = new BerOutputStream(_socket.getOutputStream());
h.encode(bos);