Results 1 to 2 of 2

Thread: jaxb1 behaviour

  1. #1
    Join Date
    Sep 2004
    Posts
    346

    Default jaxb1 behaviour

    1) With sping-ws integration what's the recomended way to instantiate beans in app context given you are supposed to use ObjectFactory to instantiate beans

    2) is there an abstraction that would avoid tying your code to jaxb through mention of objectFactory in the case you have to instantiate bean in code

    3) I was using castor b4 and now I want to use jaxb. I have multiple packages where in the root of both packages, I have classes of the same name. With castor that wasn't a problem I just needed to specify when I receive x in xml then use class y.. i.e:

    <mapping>
    <description>Description of the mapping</description>
    <class name="com.xxx.common.domain.xsd.java.errormessager eply.ErrorMessageReply"
    auto-complete="true">
    <map-to xml="ErrorMessageReply"/>
    </class>

    How do I do that with jaxb1

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by garpinc2 View Post
    1) With sping-ws integration what's the recomended way to instantiate beans in app context given you are supposed to use ObjectFactory to instantiate beans
    Interesting. I usually directly use to the implementation classes. You could wire up an ObjectFactory, of course, but since it doesn't implement an interface, it is harder to mock in unit tests.

    Quote Originally Posted by garpinc2 View Post
    2) is there an abstraction that would avoid tying your code to jaxb through mention of objectFactory in the case you have to instantiate bean in code
    Not yet. All marshalling frameworks are different, so it is hard to accomplish this. It's an interesting thought though, and perhaps I should investigate it further.

    Quote Originally Posted by garpinc2 View Post
    3) I was using castor b4 and now I want to use jaxb. I have multiple packages where in the root of both packages, I have classes of the same name. With castor that wasn't a problem I just needed to specify when I receive x in xml then use class y.. i.e:

    <mapping>
    <description>Description of the mapping</description>
    <class name="com.xxx.common.domain.xsd.java.errormessager eply.ErrorMessageReply"
    auto-complete="true">
    <map-to xml="ErrorMessageReply"/>
    </class>

    How do I do that with jaxb1
    Perhaps you can use multiple marshallers? And tie them to particular endpoints?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •