Announcement Announcement Module
Collapse
No announcement yet.
Problem with SimpleWebServiceOutboundGateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with SimpleWebServiceOutboundGateway

    Hi - Im using SimpleWebServiceOutboundGateway to call a web service with no repsonse, so I don't have a reply channel set up. However it always seems to be throwing the following exception:


    org.springframework.integration.channel.ChannelRes olutionException: unable to resolve reply channel for message: [Payload=<test:LogRequest xmlns:test="http://www.test.com/test/schemas/test">Testing Web Service Call from Eclipse</test:LogRequest>][Headers={springintegration_id=70f9d835-28cd-4384-b37f-ba437819ad43, springintegration_timestamp=1237835950850}]
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.resolveReplyChannel(Abs tractReplyProducingMessageHandler.java:138)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:101)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:48)


    My initial payload is a String and from looking at the code it looks like the doHandle method in SimpleWebServiceOutboundGateway returns an empty string instead of null to handleRequestMessage in AbstractWebServiceOutboundGateway which may be causing the problem as there is a check for null there and since its not null it sets the reply holder which I think is causing it to look for the reply channel.

    Is this a bug? I can raise a JIRA if it is.

    Thanks in advance

    David Geary

  • #2
    I guess technically this is not a bug per se, but we could handle this consistently by adding an "outbound-channel-adapter" in the WS namespace (whereas "gateway" is used for request/reply throughout Spring Integration). One thing you can do is add an outbound-channel that is an instance of NullChannel. The NullChannel is capable of logging, but otherwise it just drops the Message.

    Comment


    • #3
      Thanks for the reply Mark - thats what I was going to do for now to get around it. Its just that the in the documentation and code it looks like its possible to use it without a reply channel set. There seem to be checks for no response in handleMessageInternal where it then doesn't look for the reply channel - its just that the returned empty string isn't being caught.

      Comment


      • #4
        I think ultimately we should either clean up the code there and handle it consistently, or fix the "technically not a bug".

        Comment


        • #5
          I agree that we need to handle this. What I meant by "technically not a bug" was that a "gateway" is intended for request/reply. However, we do not provide an outbound-channel-adapter alternative for outbound Web Service invocation. In terms of consistency, this empty String return value is not being treated the same as null, because there may be cases where an empty string is a valid return value. The most important thing to recognize here is that behavior exists in AbstractReplyProducingMessageHandler. Therefore, it applies to all components that extend that (ServiceActivator, Transformer, etc).

          David, please report this issue, and we will address it for 1.0.3. The two main options I see are 1) provide an "outbound-channel-adapter" in the WS namespace that does not expect a reply at all (ignores empty string) or 2) provide some configuration option for ignoring empty string in any component.

          There may be better options than those, so I am definitely open to suggestions.

          Thanks.

          Comment


          • #6
            Just to be clear about this, fixing the "technically not a bug" would be a bad idea I think. Since there is a workaround it seems logical to postpone the outbound-channel-adapter.

            Comment


            • #7
              I agree. We can probably provide that as part of 1.0.3. In the longer term (2.0), it may be worth revisiting the idea of replies in general. This particular use-case shows that ignoring an empty String may be desirable, but there are also use-cases covering the other extreme... where a return value may be null (or empty) but the user still wants a "status" message to be sent in the reply.

              Comment


              • #8
                David,

                Could you please check my last comment on the JIRA issue?:
                http://jira.springframework.org/browse/INT-630

                I'm trying to find the simplest solution to this, and I'm hoping that last comment captures it.

                Thanks,
                Mark

                Comment


                • #9
                  I resolved the issue. Please give the SVN trunk version a quick test with your particular use-case if you can. The 1.0.3 release is just around the corner (hopefully tomorrow).

                  -Mark

                  Comment

                  Working...
                  X