Announcement Announcement Module
Collapse
No announcement yet.
Handling empty response in Webservice Outbound Gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling empty response in Webservice Outbound Gateway

    Hi,

    I am consuming a webervice uing int-ws:outboud-gateway. For some input the webservice does not return any resposne, I tried handling this using ignore-empty-response="false", but no luck. Flow stops there with out throwing any error, or providing any response to reply-channel or nullChnnel.
    I have a usecase where I must handle such situation either by throwing error or routing to different channel.

    I am using integration jar version 2.1.0.RELEASE.

    Can somebody suggest what we can do to fix ths.


    Thanks
    Vishal

  • #2
    With 2.2, you can use a custom advice to detect a null reply.

    http://static.springsource.org/sprin...#custom-advice

    The outbound gateway does have a properry 'requiresReply' but it's not currently exposed using the namespace. We are working on making that available in 3.0.

    https://jira.springsource.org/browse/INT-2822

    There is a work-around in the JIRA (define the gateway as a <bean/> within a <chain/>, and set requiresReply=true).

    Comment


    • #3
      Thank you Gary!

      This solved my problem.

      Comment


      • #4
        Hi!

        As you can see within https://github.com/SpringSource/spri...ation/pull/768 I don't plan to add 'requires-reply' to the <ws:outbound-gateway>, because I don't see any case, where the web-service (through WebServiceTemplate) returns just NULL.
        Can you explain, please, how do you get it? Thanks.
        If there is really a reason to add 'requires-reply' to the <ws:outbound-gateway>, we'll do it, of course.

        Take care,
        Artem

        Comment


        • #5
          Hi Cleric.
          In our case the thirdparty aplication had some internal error (HTTP Status 500),but there was no response to the request, as the ws:outboundgateway din't understand the status, it accepted as empty response.If you require more information PM me,

          Thanks
          Vishal

          Comment


          • #6
            Hi!

            Got it! To be more consistent and to have more coverage with WebServiceTemplate I'll add 'requires-reply' to the <ws:outbound-gateway>, but as 'false' by default: there is some point, where doSendAndReceive returns null.

            From other side, if you use HTTP-transport I see only one case, when WebServiceTemplate#hasError return false:
            AbstractHttpSenderConnection#isXmlResponse - your server doesn't return xml 'Content-Type' header.
            Am I right?

            Comment

            Working...
            X