• 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

Returning Custom data type from a web service

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone,

I am returning a custom data type from my webservice. At the same time when there is an error in the business process, I need to return an error message which is not part of the Response (custom data type).

How do i deal with this situation, and how can i implement this ? (My response data type and the error message format are different). I am using weblogic, so my serialization classes are generated by weblogic tools.

I tried setting the return type of my webservice to be java.lang.object and on my client side appropriately typecast it, but when i receive the response back on my client side, a serialization error is raised.

TIA
karthik
 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you dont need to handle error messages seperately and since all server side exceptions are translated as AxisFaults to the client, we can have an handler on the client side that can format that AxisFault to a more user friendly error message or wrap it around an object of your choice ...
 
Karthik Mohan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
our specifications have custom error messages and error numbers. So i need to return custom error messages. Also i am using weblogic and not Axis.

Thanks
karthik
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WS and SOAP have error processing built it. You should make use of the existing tools to solve your problems. SOAP Faults writeup
Tags include: faultcode, faultstring, faultactor, and detail.
 
This tiny ad is guaranteed to be gluten free.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic