You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Godfrey <da...@gmail.com> on 2013/08/06 23:14:07 UTC

Unmarshalling problems using Simple Frontend and Aegis

I have been trying to publish a simple web-service using a Java first approach. I have a Java class which uses an underlying domain model based on interfaces, for example, the class I want to publish as a web-service looks something like this:

    public class MyService {
        public Zone getZone(long zoneID) {
	    ….
        }
        public void createZone(Zone zone) {
            ….
        }
    }

Where Zone is defined by a separate interface and implemented as ZoneImpl.

I've used ServerFactoryBean to publish MyService as a web-service.

When I invoke the getZone operation from my web-service client, all works perfectly. When I invoke the createZone operation, my downstream processing in Hibernate is failing, as it expects that Zone is actually a ZoneImpl, yet what I get passed to the createZone() method is an instance of com.sun.proxy.$Proxy20.

Is there some way I can control how this works, so that a ZoneImpl is created when the XML in the SOAP request is unmarshalled? I'm using Aegis to manage data binding, as trying to use JAXB with interface based models seemed to be very difficult.