Thanks for the quick reply Tomek, just a few further questions:

i pretty much understood what readobject will do, but I'm confused
with the writeobject...
could you provide me an example?

Also, I dropped an empty Type, just to debug and check the sequence
that events happen and I'm gettng a:
javax.servlet.ServletException: The name "" is not legal for JDOM/XML
namespaces: Namespace URIs must be non-null and non-empty Strings.
org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:143)

here's my simple test...

public SimNaoEnumType(){
                setTypeClass(SimNaoEnum.class);
                setSchemaType(new QName("http://enums.model.x.com";));
        }
        
        public Object readObject(MessageReader reader, MessageContext context)
                        throws XFireFault {
                XMLStreamReader xml = 
context.getInMessage().getXMLStreamReader();
                return null;
        }

        public void writeObject(Object object, MessageWriter writer,
MessageContext context)
                        throws XFireFault {
                SimNaoEnum simNaoEnum = (SimNaoEnum)object;
        }


Could you give me a direction here?

Best regards

On 10/25/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote:
Maybe try using http://xfire.codehaus.org/Custom+Types to handle your
custom enum.

On 10/25/06, Vinicius Carvalho <[EMAIL PROTECTED]> wrote:
> 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
>
>


--
-----
When one of our products stops working, we'll blame another vendor
within 24 hours.

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

    http://xircles.codehaus.org/manage_email




--
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