5 Replies Latest reply on Aug 4, 2005 12:13 PM by clairecostello

    Use of JBossXB

    clairecostello

      Hi All,

      Not sure where to post this question. Perhaps it should be in the JBoss CMP forum?

      My Webservice accepts a String argument which is XML corresponding to an XML Schema agreed between the client and server parties. My question is what to do with the XML to create my entity bean (CMP bean)? I am looking at JBossXB but have a couple of questions:

      It looks as though I have to add annotations to my XML Schemas. Is this the only addition I have to make to my Schemas? Can this metainfo for POJOs be specified in any other way other than altering the XML Schemas themselves?

      Are there any connections between JBossXB and JAXB? If so, where can I read about them?

      Where can I get the required APIs to build my source once I use the XB mechanism?

      Can I go from XML to Entity bean creation? (ambitious perhaps?)

      Many thanks for answers to these questions, or some URLs.

      -Claire

        • 1. Re: Use of JBossXB
          starksm64

          Map it to a session bean that creates the entity. JBossXB does not support the java5 annotation driven processing yet.

          http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossXB

          • 2. Re: Use of JBossXB
            clairecostello

            Hi Scott,

            Thanks for that. Just to see if I have interpreted your post correctly: When you say "Map it to a session bean" -> what do you mean by "it"?

            Should I use JBossXB in my session bean which handles the WS invocations and then create entity beans using the java objects generated? I am using java 5 - which cannot interpret annotation tags? Does this mean I can't use JBossXB. So should I use JAXB instead?

            The Wiki pages are helpful but I just want to clarify your answer.

            • 3. Re: Use of JBossXB
              starksm64

              Since a session is a valid endpoint for a webservice request, and an entity is not, you need to map the ws request to the session.

              • 4. Re: Use of JBossXB
                clairecostello

                Yes, the WS requests are mapped to a session bean and the client can call the WS successfully. Now I want to take the WS params and create entity beans in ejb container. So, should I use Sun's JAXB implementation or JBossXB to translate my WS params into entity beans?

                Thanks for your help on this. I would prefer to use a binding and marshalling mechanism rather than parsing the XML into a DOM or use a SAX parser.

                • 5. Re: Use of JBossXB
                  clairecostello

                  Hi,

                  I've downloaded the JWSDP 1.6 and will use JAXB to bind XML Schemas to Java classes and unmarshal the WS params using the generated Java classes.

                  Suggested alternatives to this approach welcomed (if in some way necessary).