GeeCON Prague 2014*
The moose likes Web Services and the fly likes standard error messaging in jax-ws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "standard error messaging in jax-ws" Watch "standard error messaging in jax-ws" New topic
Author

standard error messaging in jax-ws

John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 227
Hi,
I have implemented a jax-ws (tomcat) web service. It is used for remote method invocations. There is a generic method that returns Object. Now I cannot return string with an error or exception because I do not know who's calling it might be a c# client. So I am looking for a generic way to return error like on jax-ws or soap level.
Any ideas?

Thanks,
John
Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
John Landon wrote:Hi,
I have implemented a jax-ws (tomcat) web service. It is used for remote method invocations. There is a generic method that returns Object. Now I cannot return string with an error or exception because I do not know who's calling it might be a c# client. So I am looking for a generic way to return error like on jax-ws or soap level.
Any ideas?

Thanks,
John


I don't know if you've given us quite enough info to work with here. You say you are returning an Object but you cannot return a string. However, you should be able to return a string that contains the error message and it will work just fine. Jax-ws will convert the java.lang.string to xsd:string. Then c# or whomever will be able to work with that string just fine. You may want to take a look at jaxb mapping:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnazq.html#bnazv
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
Use SOAPFault to send error message.


My Blog
 
GeeCON Prague 2014
 
subject: standard error messaging in jax-ws