Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

WSDL request-response with void return type  RSS feed

 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you have the response from a request-response operation have a void return type?

I need request-response rather than one-way because the operation needs to have faults. The problem is that it is a simple operation in which if something goes wrong I can just throw a fault/exception. If all succeeds there is no reason to return anything to the client.

I.E.


This will not work since without and output tag it is one way and one way operations cannot have faults.

However if I do this:


I send something back to the client that does not need to be and should not be.

Any ideas? Thanks,
Billy
 
Yaron Naveh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The client needs to get something in order to know a fault has not occured.

If this is really important you can have a mini "service" on the client which the server can send faults to and make the original operation to one way, but I think you should leave it as is.
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree the client needs to get something to know that a fault has occurred, I.E. my code needs to block to wait to see if in fact that exception occurred. But that doesn't mean that the return type cannot be void.

I.E. this is perfectly valid code


This seems potentially confusing to clients as they probably assume that they need to check the response object for something, even though the sever could care less about what it fills the response object with. Seems hard to write well defined interfaces this way.
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok found it!

You just need to define the response correctly to get a void return type in the generated code.

I.E.


Since testSomething_output does not have a part the return type is void, but you still have a response so you can add faults.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!