Announcement Announcement Module
Collapse
No announcement yet.
Is Spring Integration right framework for this use case Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is Spring Integration right framework for this use case

    Hi,

    I am new to Spring Integration and I am surprise to see many of the common EAI frameworks are implemented in this light weight container. I am planning to evaluate SI for one of the project we have.

    It is something like Webservices chaining.
    • An external vendor needs to get data from our systems through real time (https) and the requests are sent as SOAP messages to us.
    • We have our own internal webservices built on SOAP over HTTPS.
    • The requirement is to convert (transform) the incoming SOAP messages sent by the vendor to our internal SOAP message and execute them in our internal webservices platform.

    All this new application does is transform the SOAP request and pass it on to another SOA system and vice versa.

    Is this a good fit for us to use Spring Integration ?

    Most of the discussions in the forums and the samples talk about asynchronous messaging and our application is synchronous (through HTTPS). Any suggestions will be helpful for me to proceed further.

    Thanks for your help.

  • #2
    Spring Integration should support that use-case fine, and it's not a *necessity* to have asynchronous message-passing.

    You could basically create the following pipeline:
    [public WS] ws:inbound-gateway -> transformer -> ws:outbound-gateway -> [internal WS]

    Does that make sense as a starting point for further discussion?

    Comment


    • #3
      Thanks Mark.

      I tried ws-inbound-gateway project under samples and tried adding a XSL Transformer, but i am getting below error.

      Code:
      org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. 
      	at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
      	at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
      	at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source)
      	at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
      	at com.ibm.xtq.xslt.runtime.DOMBuilder.append(Unknown Source)
      	at com.ibm.xtq.xslt.runtime.DOMBuilder.characters(Unknown Source)
      	at org.apache.xml.serializer.ToXMLSAXHandler.characters(Unknown Source)
      	at cbsping_Common_P0.cbsping$0x24$$0x24$applyTemplates$0x24$afo$0x2d$augmented$0x24$xslt1$0x24$playback$0x2d$sax$0x2d$events_content$objectless(<generated>)
      	at cbsping_Common_P0.cbsping$0x24$$0x24$applyTemplates$0x24$afo$0x2d$augmented$0x24$xslt1$0x24$playback$0x2d$sax$0x2d$events$0x24$1(<generated>)
      	at cbsping_Common_P0.cbsping$0x24$main(<generated>)
      	at cbsping.transform(<generated>)
      	at com.ibm.xtq.xslt.runtime.AbstractTranslet.transform(Unknown Source)
      	at com.ibm.xtq.xslt.jaxp.TransformerImpl.transform(Unknown Source)
      	at com.ibm.xtq.xslt.jaxp.TransformerImpl.transform(Unknown Source)
      	at org.springframework.integration.xml.transformer.XsltPayloadTransformer.transformSource(XsltPayloadTransformer.java:173)
      	at org.springframework.integration.xml.transformer.XsltPayloadTransformer.doTransform(XsltPayloadTransformer.java:157)
      	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:32)
      	at org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:66)
      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:91)
      	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:68)
      	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
      	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
      	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:44)
      	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:169)
      	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:142)
      	at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:219)
      	at org.springframework.integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:248)
      	at org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:213)
      	at org.springframework.integration.gateway.AbstractMessagingGateway.sendAndReceiveMessage(AbstractMessagingGateway.java:198)
      	at org.springframework.integration.gateway.AbstractMessagingGateway.sendAndReceive(AbstractMessagingGateway.java:178)
      	at org.springframework.integration.gateway.SimpleMessagingGateway.sendAndReceiveMessage(SimpleMessagingGateway.java:57)
      	at org.springframework.integration.ws.SimpleWebServiceInboundGateway.doInvoke(SimpleWebServiceInboundGateway.java:103)
      	at org.springframework.integration.ws.SimpleWebServiceInboundGateway.invoke(SimpleWebServiceInboundGateway.java:61)
      	at org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter.invoke(MessageEndpointAdapter.java:41)
      	at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:228)
      	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:170)
      	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
      	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      	at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      	at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:60)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:379)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:736)
      Code:
      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:int="http://www.springframework.org/schema/integration"
      	xmlns:int-ws="http://www.springframework.org/schema/integration/ws"
      	xmlns:si-xml="http://www.springframework.org/schema/integration/xml"
      	xsi:schemaLocation="http://www.springframework.org/schema/integration/ws 
      	http://www.springframework.org/schema/integration/ws/spring-integration-ws-2.0.xsd
      	http://www.springframework.org/schema/integration 
      	http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
      	http://www.springframework.org/schema/beans 
      	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      	http://www.springframework.org/schema/integration/xml
      	http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd">
      
      	<int:channel id="input"/>
      	<int:channel id="output"/>
      	
      	<int-ws:inbound-gateway id="ws-inbound-gateway" request-channel="input" extract-payload="true" />
      	
      	<int:service-activator input-channel="input" output-channel="output" method="testMethod">
      		<bean class="org.springframework.integration.samples.ws.SimpleEchoResponder"/>
      	</int:service-activator>
      	
      	<int-ws:outbound-gateway id="ws-outbound-gateway" 
      		request-channel="output" 
      		uri="http://localhost:8020/cbsrpc/services/UtilityServices"/>
      	
      	<si-xml:xslt-transformer input-channel="input" output-channel="output" 
      			xsl-resource="classpath:org/springframework/integration/samples/ws/cbsping.xslt"/>
      	
      </beans>

      Comment


      • #4
        Have you verified that your XSL transformation is working in isolation with the same input/output?

        Comment


        • #5
          Yes . I tried below code under SimpleEchoResponder.testMethod(DOMSource) method and it works fine. And moreover the xslt is not a fancy one which has lots of XSL elements. Its simple xslt which dumps out a static SOAP XML.

          Code:
          try {
          		TransformerFactory tFactory = 
          	        TransformerFactory.newInstance();
          
          		Transformer transformer = 
          	        tFactory.newTransformer(new StreamSource("C:/JavaTools/Spring Integration/spring-integration-2.0.0.M6/samples/ws-inbound-gateway/src/main/java/org/springframework/integration/samples/ws/cbsping.xslt"));
          		
          	        transformer.transform(new StringSource(a), sr);
          			System.out.println(sr);
          
          		}
          		catch (Exception exp) {
          			exp.printStackTrace();
          		}
          Moreover when I tried hard coding the PING SOAP request in testMethod(), looks like SI adds the below SOAP elements to the XML payload.
          Code:
          <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/> MY SOAP Payload       <SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>
          Can you please let me know how to fix these two issues ? Thanks for your quick responses.

          Comment


          • #6
            Would it be possible for you to attach a small sample (simple xml and xslt and config) that reproduces the error?

            Comment


            • #7
              Here is the XML and XSLT
              Code:
              <?xml version="1.0" encoding="UTF-8"?>
              <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
              	<SOAP-ENV:Header/>
              	<SOAP-ENV:Body>
              		<echoRequest xmlns="http://www.springframework.org/spring-ws/samples/echo">hello</echoRequest>
              	</SOAP-ENV:Body>
              </SOAP-ENV:Envelope>
              Below is the XSLT,
              Code:
              <?xml version="1.0" encoding="UTF-8"?>
              <xsl:stylesheet version="1.0"
              	xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
              	xmlns="http://www.test.com/module/1.0/data"
              	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              	xmlns:srvc="http://www.test.com/module/1.0/services"
              	xmlns:xalan="http://xml.apache.org/xslt ">
              	<xsl:template match="/">
              		<soap-env:Envelope>
              			<soap-env:Header>
              			</soap-env:Header>
              			<soap-env:Body>
              				<srvc:Ping>
              					<CheckDatSources>Yes</CheckDatSources>
              				</srvc:Ping>
              			</soap-env:Body>
              		</soap-env:Envelope>
              	</xsl:template>
              </xsl:stylesheet>

              Comment


              • #8
                Hi,

                Are you able to recreate this issue ?

                -Thanks.

                Comment

                Working...
                X