• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Axis] Problems with java.sql.Timestamp namespace

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi @all,

I have generate a wsdl file with the java2wsdl tool from apache axis.

Now i try to generate the skeletons with wsdl2java, but the wsdl contains following namespace declaration:

xmlns:tns2="http://sql.java"

and

<import namespace="http://sql.java"/>

if i start the tool, the following exception is thrown:

java.io.IOException: Type {http://sql.java}Timestamp is referenced but not defi
ed.at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbo
Table.java:665)

Has anyone a idea, what is the problem?

thanks in advanced

bruno
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bruno Barocco:

I have generate a wsdl file with the java2wsdl tool from apache axis.



This is were your problem starts. java.sql.Timestamp can only be understood by systems with the Java platform. Furthermore both the client and server will have to use a common serializer/deserializer for this type. There is no standard mapping for java.sql.Timestamp to XML and Axis doesn't seem to provide a serializer/deserializer for it - in which case you would have to write your own. These are the options available to you.
  • 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
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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:

    com.x.Link

    the wsdl2java generate:

    com.x.ws.Link

    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?

    greetings
     
    Peer Reynders
    Bartender
    Posts: 2968
    6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
     
    reply
      Bookmark Topic Watch Topic
    • New Topic