This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

standard error messaging in jax-ws

 
John Landon
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use SOAPFault to send error message.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic