Results 1 to 2 of 2

Thread: Mappipng unaware @Endpoint implementation (JAXB2)

  1. #1
    Join Date
    May 2008
    Posts
    2

    Default Mappipng unaware @Endpoint implementation (JAXB2)

    Hi,

    As it's currently implemented, Endpoint implmentation that uses mapping IS compile-time dependent on the mapping type used.
    In other words, the Endpoint implementation does not share tha beauty of POJO

    Code:
        (at)PayloadRoot(localPart = "LoadImageRequest", namespace = "...")
        public JAXBElement<Image> load(JAXBElement<String> requestElement) throws IOException {
            String name = requestElement.getValue();
            Image response = new Image();
            response.setName(name);
            response.setImage(imageRepository.readImage(name));
            return objectFactory.createLoadImageResponse(response);
        }
    The following code would be much more elegant and less verbose.

    Code:
        (at)PayloadRoot(localPart = "LoadImageRequest", namespace = "...")
        public Image load(String name) throws IOException {
            Image response = new Image();
            response.setName(name);
            response.setImage(imageRepository.readImage(name));
            return response;
        }
    It does not look too difficult to create some kind of wrapper arround JAXB2 mapper or (un)marchaler to support the "mapping-less" endpoint implementations.

    Does it make sence for you? what do you think?

    Thanks
    Vitaliy

  2. #2
    Join Date
    May 2008
    Posts
    2

    Default Got it

    Hi,

    Sorry for disturbing.. actually the second implementation is already possible, depending on the way we create the XSD

    Thanks

Posting Permissions

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