• 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

web services interoperabilty

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

A web service can return any custom data type but is that a good idea? I am developing a web service in Java and wonder whether I should limit the return types to a String containing the structure I want to return as an XML or whether I can return instances of custom classes and how that would be handled. I guess custom classes are just serialized (or?) and if I do not have a java client on the other side I cannot instance the class so that's no good, but even if I do have a Java client I then need to have the class definition on the client side anyhow...

How does it actually work?

Thanks,

A.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi "iggy ziggy",
Welcome to the JavaRanch. There aren't many rules around here, however adherence to the JavaRanch Naming Policy is one of them. Please change your display name to one that complies with that policy. Your cooperation is appreciated.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello iggy ziggy(strange name!)
Please read Designing WebServices- SUN Blue prints 4th chapter XML Processing & 5 th chapter Client Design, where lot of scenarios are discussed talking about when to use xml and when to use custom objects..
It doesnt matter even if you have non-java client.. Their tools generate client classes in corresponding languages given the wsdl document..
You dont have to distribute java classes to clients.. From the wsdl doc, the tool can create the necessary input, output classes..
But there are other things that you have to consider in deciding to use xml or java classes for input & output. for e.g
1) Data Size - How much data is being communicated back and forth per request/transaction (1K, 1M, 10M)?
2) Data frequency - How often will the data be "queried", daily, weekly, each time a user clicks some button on a UI?
3) Data Type - Structured text based data, images, engineering files etc?
 
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

Originally posted by iggy ziggy:
A web service can return any custom data type but is that a good idea?


No it isn't. However that doesn't mean that you should limit yourself to only primitive types either. Have a look at these topics:

Web services != RPC
WSDL question
Axis or Axis2
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic