简体   繁体   中英

Java Pojo Classes -> ASN.1 for RPC

I would like to do some RPC with the format of the messages being directly defined from Java interfaces, then I want to use some tools to generate the ASN.1 files.

  1. Do you know what tools I can use? (if possible, something that doesn't force me to use any type from an ASN library in the interfaces which describe the format.

  2. Do you know if there are libraries to do RPC with ASN.1 in a JavaSE program?

我想注释类和编写生成ASN的注释处理器可能是一种方式,但我无法猜测它将需要多少工作。

i think you already checked

  • BinaryNotes
  • Bouncy Castle
  • except
  • PowerASN

you want something like spring remote exporters, but no such facility exists. it would be a hot project may be called ASNExporter , if you started one using netty, mina, pure NIO, OIO, bouncycastle, spring, AOP.

You may want to have a look at Java Web Services Developer Pack 2.0 that includes Fast Infoset 1.0.1 FCS release acceleration technology built on ASN.1 standards. Fast Infosets is quite interesting piece of technology that was started by SUN Microsystems few years ago and still available in Glassfish that has superseded JWSDP.

In general Fast Infoset implementats SAX and StAX interfaces. This allows any XML technologies to be used with Fast Infoset provided that they support either SAX or StAX. So it's generally that easy to have Java objects marshalled to and unmarshalled from ASN.1. On one of the conferences Fast Infoset was also referred as binary XML .

So you can annotate your POJOs with JAXB annotations and marchall to ASN.1 with JAXB, or you can use less intrusive library like XStream to accomplish the same.

Few links:

Have a look at the Apache Harmony project .

The website says:

The ASN.1 framework provides a common, easy and efficient approach for working with ASN.1 basic types, notations and encoding rules. This framework can be described as a layer between a Java* object and its ASN.1 encoded form, as shown in Figure 1.

图1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM