This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
  • Write a custom axis serializer/deserializer.
  • Convert the timestamp to a java type that has a standard mapping as specified in Java API for XML-Based RPC (JAX-RPC) Specification 1.1 (JSR-101); Section: 5. Java to XML/WSDL Mapping like java.lang.String or java.util.Date.
  • Simply design your service WSDL-first and use the supported XSD types as outlined in Java API for XML-Based RPC (JAX-RPC) Specification 1.1 (JSR-101); Section: 18. Appendix: XML Schema Support (This is the preferred solution). Though "SOAP" initially included the word "Object" in its now abandoned expansion, Web Services really are only XML-based messaging systems - they are not an effective object remoting solution. Distill the data of your objects on one end, send the data to the other end, and then reconstitute the objects in a manner that is supported by the underlying platform.

    Bruno Barocco
    Posts: 2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Peer,

    Thanks for your answer, you see i am a webservice beginner.

    so i get already the next problem.

    The generated sources are incompatible to the business classes, for example:

    i have a class:


    the wsdl2java generate:

    but these both classes are incompatible(not the same interface or subtype). Its very expensive to write all Wrapper classes manual. Do you know a pattern, or what is the best practice solution in this case?

    Peer Reynders
    Posts: 2968
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Most likely your business classes and operations are too fine-grained for a Web Service. The are many "calculator" Web Services in tutorials � however those WS are not representative of what WS should be used for � submitting an entire XML purchase order is more like it.
    WebServices versus EJB

    Once you operate at a higher level of granularity there will probably be less wrapper code to write and maintain. You can also use JAXB to alleviate the object -> XML -> object conversion coding burden somewhat.
    Java Architecture for XML Binding (JAXB) FAQs
    JAXB 2.0 Project
    Using JAXB: Basic Examples

    Patterns and Strategies for Building Document-Based Web Services
    3.7 Handling XML Documents in a Web Service
    4.3 Designing XML-Based Applications
    permaculture is giving a gift to your future self. After reading this tiny ad:
    The WEB SERVICES and JAX-RS Course
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!