wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Don't get me started about those stupid light bulbs.
 
subject: standard error messaging in jax-ws
 
Similar Threads
JAX-RPC vs JAX-WS some differences
JBoss WS client exception
Is JAX-WS method ArrayList
Handling non numeric argument
Eclipse web service client. Where can i get the SOAP?