简体   繁体   中英

Marshalling Complex Types in a Web Service with Java

I want to expose the following class as a web service.

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.

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. But any solution will do.

Make your own class that inherits from DenseDoubleMatrix2D and has a default constructor. Or use JAX-B and read http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html . CXF also supports JAX-B.

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