Results 1 to 5 of 5

Thread: ws:inbound-gateway errorhandling and reply message

  1. #1

    Default ws:inbound-gateway errorhandling and reply message

    Hello.
    I hava small question referes to ws:inbound-gateway errorhandling.

    I've created small error handling chain

    <int:chain input-channel="failed-invitations">
    <int:transformer ref="errorUnwrapper" />

    <int:service-activator ref="PartyHost" method="onFailed" />
    </int:chain>
    My onFailed method returns correct reply XML (I can see it in my logs) with no errors .


    public Source onFailed(DOMSource inDOMSource) throws Exception {

    ...
    return new DomSourceFactory().createSource(
    "<MyXML>...</MyXML>");



    }
    Problem is that this reply message is not sent to the client.

    Client receive empty response message (only http headers).

    My question is :

    What should I do to send WS reply in my error chain ?


    regards Marcin

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    740

    Default

    Hello

    1. Is your ws:inbound-gateway marshalling?
    2. Can you debug AbstractWebServiceInboundGateway implementation to determine what's going on?

    It should work: I've got similar solution and I remember it was my requirement to add to ws:inbound-gateway error-channel attribute to make error recovering via Spring Integration not Spring-WS EndpointExceptionResolver...

    Take care,
    Artem

  3. #3

    Default

    Quote Originally Posted by Cleric View Post
    Hello

    1. Is your ws:inbound-gateway marshalling?
    2. Can you debug AbstractWebServiceInboundGateway implementation to determine what's going on?

    It should work: I've got similar solution and I remember it was my requirement to add to ws:inbound-gateway error-channel attribute to make error recovering via Spring Integration not Spring-WS EndpointExceptionResolver...

    Take care,
    Artem
    1. no
    2. I will test it
    It is very simple application based on ws:inbound-gateway and errorhandling examples.

    In my ws:inbound-gateway I use ws:outbound-gateway.

    Im trying to send my own reply when ws:outbound-gateway fails.

    My simple project in attachement.

    When flow ends with success simple service activator generate reply
    When flow fails another simple service activator generate reply but this reply is not returned to client.
    Attached Files Attached Files

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    740

    Default

    H-m-m.
    There are a lot of configs and classes in your application.
    Can you simplifiy it only around a problem of ws:inbound-gateway and error-flow?

  5. #5

    Default

    Quote Originally Posted by Cleric View Post
    H-m-m.
    There are a lot of configs and classes in your application.
    Can you simplifiy it only around a problem of ws:inbound-gateway and error-flow?

    When ws:outbound-gateway fails flow goes to failed-invitations chain


    <int:channel id="failed-invitations" />

    <int:chain input-channel="failed-invitations">
    <int:transformer ref="errorUnwrapper" />

    <int:service-activator ref="PartyHost" method="onFailed" />
    </int:chain>
    In this chain PartyHost executes with no error:

    if (1==1)
    throw new Exception(
    "<echoResponse xmlns=\"http://www.springframework.org/spring-ws/samples/echo\">AAAAAAAA</echoResponse>");
    this line generate soapfault. I can see it in http reply.

    But now I would like generate not soapFault but my custom reply.

    When I delete thorow operation method onFailed returns my custom reply.

    return new DomSourceFactory().createSource(
    "<echoResponse xmlns=\"http://www.springframework.org/spring-ws/samples/echo\">" +
    "AAAA"+ "</echoResponse>");
    This reply I can not see in http reply.
    I see only http headers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •