Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a one-way SOAP message send a fault?

 
Ravi Danum
Ranch Hand
Posts: 154
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is there a way for a one-way SOAP message to send a fault if an error occurs? I have implemented a web service by creating the service from a wsdl. When I try to throw an exception it gives an error saying a one-way SOAP msg cannot throw an exception.

Thanks for any help here.

Ravi
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the spec's seem to be a bit vague about this, to the point that even the experts disagree. Apparently you are allowed to generate a SOAPFault but in One-Way transmission you are not allowed to return it.

Using SOAP with J2EE
J2EE Web Services wrote:SOAP faults are generated by receivers, either an intermediary or the ultimate receiver of a message. The receiver is required to send a SOAP fault back to the sender only if the Request/Response messaging mode is used. In One-Way mode, the receiver should generate a fault and may store it somewhere, but it must not attempt to transmit it to the sender.


Consequently you would need to add a fault retrieval operation. The problem with One-Way is that the sender isn't expecting a response. So if you have any potential faults it is simpler to just go Request/Response and return a success message when all is well.
 
Ravi Danum
Ranch Hand
Posts: 154
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Peer. That makes the most sense.

Ravi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic