Announcement Announcement Module
Collapse
No announcement yet.
JAX-Ws to Spring Integration bridge Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JAX-Ws to Spring Integration bridge

    Hi Everyone,

    I have a requirement to use JAX-WS webservice in the front and Spring Integration components to implement the back end logic.

    I know that Spring WS gels very well with the SI components. I can just have a PayloadRootQNameEndpointMapping and push it to the SimpleWebServiceInboundGateway.

    But we need to have the webservice as JAX WS Endpoint and be able to pass the control to these inbound gateways depending on whichever method is called.

    Any pointers? Code snippets? Thanking a ton in anticipation.

  • #2
    One option I see is: You can make your JAX-WS SEI (service endpoint interface) Spring aware by having it extend SpringBeanAutowiringSupport.

    Then you can inject an intermediate service into your SEI (using @Autowired for example) and let this intermediate service act as a bridge between your JAX-WS webservice and SI. This intermediate service can send incoming web service requests (as received by the JAX-WS SEI) and write these to a SI channel. This can easily be accomplished by annotating the methods with @Publisher.

    Comment


    • #3
      Thans for your reply. I did go that route. Unfortunately, our target server is Weblogic 10.3 and JAX-WS autowiring doesn't work on WebLogic Server.

      http://forum.springsource.org/showthread.php?t=58272

      Comment


      • #4
        You can always lookup the bean in the application context, if the autowiring doesn't work in this case.

        We had exactly same requirement, and this is what you can do:

        1. Write JaxWS SEI, which has all the methods, which you want to expose. Annotate as required (@Webservice, @Webmethod etc)
        2. Your PayloadRootQNameEndpointMapping is probably mapping to a given SimpleWebServiceInboundGateway bean in your context, and there would be a requestChannel configured for this bean, something like this:

        <beans:bean id="myInboundWSGateway"
        class="org.springframework.integration.ws.SimpleWe bServiceInboundGateway">
        <beansroperty name="replyTimeout" value="15000" />
        <beansroperty name="requestTimeout" value="15000" />
        <beansroperty name="extractPayload" value="false" />
        <beansroperty name="requestChannel"
        ref="myInboundRequestChannel" />
        </beans:bean>
        3. From your SEI, use a SimpleMessagingGateway bean, and with the parameters received from the Webmethod, create a SI message with appropriate payload and headers, and invoke sendAndReceiveMessage on this bean.

        Does this sound feasible?

        Comment


        • #5
          Originally posted by [email protected] View Post
          Thans for your reply. I did go that route. Unfortunately, our target server is Weblogic 10.3 and JAX-WS autowiring doesn't work on WebLogic Server.

          http://forum.springsource.org/showthread.php?t=58272
          That issue should be fixed in Spring 3.0.1 (https://jira.springframework.org/browse/SPR-5652)

          Comment

          Working...
          X