简体   繁体   English

使用Java编组Web服务中的复杂类型

[英]Marshalling Complex Types in a Web Service with Java

I want to expose the following class as a web service. 我想将以下类公开为Web服务。

import cern.colt.matrix.impl.DenseDoubleMatrix2D;

public class MatrixAlgebraImpl implements MatrixAlgebra{

    public DenseDoubleMatrix2D echo(DenseDoubleMatrix2D matrix) {
        return matrix;
    }
}

However DenseDoubleMatrix2D does not have a default constructor and its a third party library so I can't apply any annotations. 但是DenseDoubleMatrix2D没有默认的构造函数及其第三方库,因此我无法应用任何注释。

http://acs.lbl.gov/software/colt/api/cern/colt/matrix/impl/DenseDoubleMatrix2D.html http://acs.lbl.gov/software/colt/api/cern/colt/matrix/impl/DenseDoubleMatrix2D.html

Ideally I would prefer not to annotate any code and have been looking to do this with CXF and Aegis. 理想情况下,我希望不对任何代码进行注释,并且一直在寻求使用CXF和Aegis进行此操作。 But any solution will do. 但是任何解决方案都可以。

Make your own class that inherits from DenseDoubleMatrix2D and has a default constructor. 制作自己的类,该类继承自DenseDoubleMatrix2D并且具有默认构造函数。 Or use JAX-B and read http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html . 或使用JAX-B并阅读http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html CXF also supports JAX-B. CXF还支持JAX-B。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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