OK here is what i am trying to do i have created a web service which gets the xml request and than using spring integration some processing is done over that request and the response is sent back to the client Here i am using soap ui(a tool to test services) to send the xml request to the service and the response is also shown in the same.
Now in the service i do some processing with the request to validate whether the request is valid (i have t check whether the identities that are used in the request are valid one).
In one of the processing step what i want to do is get the data from the request validate it and if data is valid than put it in the header and if the validation fails send a error response(i am doing this processing in header enricher, if the validation fails i throw a validation exception which is propagated to the error channel and the error response is shown in the soap ui).
My problem is the flow goes to the error channel and the error response is also generated but the error is not shown in the soap i get a exception like there is no response shown in the soap ui
The following is the exception
2011-11-08 09:38:31,791 WARN [org.springframework.integration.channel.MessagePub lishingErrorHandler] - Error message was not delivered.
org.springframework.integration.support.channel.Ch annelResolutionException: no output-channel or replyChannel header available
at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendReplyMessage(Abstra ctReplyProducingMessageHandler.java:166)
at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.produceReply(AbstractRe plyProducingMessageHandler.java:125)
at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleResult(AbstractRe plyProducingMessageHandler.java:119)
at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:101)
at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:78)
at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
at org.springframework.integration.channel.MessagePub lishingErrorHandler.handleError(MessagePublishingE rrorHandler.java:83)
at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 55)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
Hope now the issue is clear please let me know if u need more explanation....
Thanks for your help. Please throw some light on this
So I am assuming you are using <int:ws-inbound-gateway>, right?
If so that all you need is specify an error-channel on this gateway and add a subscriber to such error-channel to receive the ErrorMessage and construct whatever response you want to send (error, soap fault etc.)
But by default you don't even need to do anything since the exception wil be converted to soap fault and sent bac to the caller
Yes i am using <int:ws-inbound-gateway>.
Will try it out thanks for your reply...
I had one more query like if i use more than one gateway inside a chain and each gateway has a error channel for it and if i get an error in one gateway will the execution stop at that point or will it got to the subsequent gateways in the chain.
As i see that the execution doesnt stop and it goes to the next gateway and than so on.
I am generating a Domsource xml in the errorhandler for errochannel in the gateways.
When you have multiple gateways in the flow you essentially segmenting (scoping) the flow, thus allowing errors to be handled within a particular segment (scope). This is a very interesting technique which I've demonstrated few weeks ago at SpringOne. Here is the code you might want to look at: https://github.com/olegz/s12gx.2011/...n/segmentation