Hello there! I one of our applications using XFire (I'm really proud
to say that we have 2 systems deployed with XFire solutions). We need
to expose some "legacy" Hibernate entities. Those classes uses Enums
(in the hibernate way, not the enum type from java 5.0). A sample of
our enums:

public class SimNaoEnum extends PersistentCharacterEnum {
        private static final long serialVersionUID = 4418724242125942112L;
        public static final SimNaoEnum SIM = new SimNaoEnum("Sim",'S');
        public static final SimNaoEnum NAO = new SimNaoEnum("Nao",'N');
        protected SimNaoEnum(String description,char code){
                super(description,code);
        }
        public SimNaoEnum(){}
}

PersistentCharacterEnum is the same as explained at:
http://www.hibernate.org/203.html

Well, these entities when exposed throw an error:

org.codehaus.xfire.XFireRuntimeException: Could not invoke service..
Nested exception is org.codehaus.xfire.fault.XFireFault: No write
method for property {http://enums.model.x.com}code in class
com.x.model.enums.SimNaoEnum
org.codehaus.xfire.fault.XFireFault: No write method for property
{http://enums.model.waybrasil.com}code in class
com.x.model.enums.SimNaoEnum
        at 
org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
        at 
org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
        at 
org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
        at 
org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
        at 
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
        at 
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
        at 
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
        at 
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
        at 
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
        at org.codehaus.xfire.client.Client.invoke(Client.java:335)
        at 
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
        at $Proxy1.atualizarDados(Unknown Source)
        at 
com.x.services.assinante.informacoes.test.InformacaoServiceClientTest.testAtualizarClientes(InformacaoServiceClientTest.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

We are using Xfire's XFireClientFactoryBean bean. I understand that
there's no write method for the enum, as it is used in a static way.
Is there an easy way to solve this? We have lots of domain objects
mapped this way, I'd like to avoid using Wrappers for that

Best Regards


--
IBM Certified SOA Solution Designer
IBM Database Associate - DB2 UDB V8.1 Family

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to