Hello All,
After some more research, I saw where the xfire is
calling the JAXB2 marshal methods in
org.codehaus.xfire.jaxb2.writeObject.

I wrote a JUnit test to see how Jaxb was marshalling
my types and it looks like this is a JAXB bug.  Here
is my JUnit test.  Notice how the attribute
'recordURI' has the wrong namespace.  I also compiled
these schemas with XMLBeans and no problem.  Will the
eclipse pluging for xfire allow you to do
client/server stub generation with xmlbeans in the
future?


Here is the Junit test:
        public void testThis()
        {
                System.out.println("Hello");
                
                JAXBContext jc;
                JAXBContext jc1;                
                try {
                        jc =
JAXBContext.newInstance("gov.wisconsin.wijis.specs.schemas.gateway.service.recordretrieval.v1");
                
                Marshaller m = jc.createMarshaller();
                m.setProperty(Marshaller.JAXB_FRAGMENT,
Boolean.TRUE);
               
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

               
//m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
"WSDL/RecordRetrievalSerivceInterface.xsd");
                
                
                RecordRetrievalRequest request = new
RecordRetrievalRequest(); 
                request.setRecordURI("http://www.yahoo.com";);

                 m.marshal(request, System.out);
                 
                 OutputStream out = new FileOutputStream(new
File("rrRequest.xml"));
                 m.marshal(request, out);
                 out.close();

                                jc1 =
JAXBContext.newInstance("gov.wisconsin.wijis.specs.schemas.gateway.pointer.v1_0._2006_05_25");
                                
                        Marshaller m1 = jc1.createMarshaller();
                        m1.setProperty(Marshaller.JAXB_FRAGMENT,
Boolean.TRUE);
                       
m1.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
true);  
                
                PointerManagementInvocationType pmiJAXB = new
PointerManagementInvocationType();
               
pmiJAXB.setSubmitterURI("http://www.pointermanagementJAXB.com";);

                m1.marshal(pmiJAXB, System.out);
                 
                
                 out = new FileOutputStream(new
File("pmRequest.xml"));
                 m1.marshal(pmiJAXB, out);
                 out.close();

                JAXBContext jcUn =
JAXBContext.newInstance("gov.wisconsin.wijis.specs.schemas.gateway.service.recordretrieval.v1");
                        Unmarshaller u = jcUn.createUnmarshaller();     
                        
                        RecordRetrievalRequest requestUn =
(RecordRetrievalRequest) u.unmarshal(new
File("rrRequest.xml"));
                        System.out.println("\n\n\nMY RECORD URI:  " +
requestUn.getRecordURI());
                        
                        
                        
                        } catch (JAXBException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (FileNotFoundException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
            
                        

        }


Here is the message that I posted to the JaxB forum:

http://forums.java.net/jive/thread.jspa?threadID=21714&tstart=0

If anyone has an ideas, let me know.

Thanks!

Yogesh

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

    http://xircles.codehaus.org/manage_email

Reply via email to