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?
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