1 2 3 Previous Next 33 Replies Latest reply on Feb 15, 2013 4:23 AM by ubm Go to original post
      • 15. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
        kcbabo

        You can grab a nightly build of 0.8 which will correspond to 0.8.0-SNAPSHOT from here:

        https://hudson.jboss.org/hudson/job/SwitchYard-Release/

         

        The 0.1.0 version of the BPMN 2 editor should be fully functional w/r/t SwitchYard features.  We are looking at bumping the version and using ServiceTask, but the investigation into that is not complete yet.

        • 16. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
          dward

          +1 Keith.

          • 17. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
            andi.scharfstein

            Okay that's great, I'm making progress

             

            I am now seeing the error messages leading to my problem. Surprisingly enough, transformers are not mentioned. What I'm getting is the following:

             

            15:24:08,023 ERROR [org.switchyard.component.bpm.work.SwitchYardServiceWorkItemHandler] (http-localhost-127.0.0.1-8180-1) Fault encountered: Unexpected exception handling SOAP Message: org.switchyard.HandlerException: Unexpected exception handling SOAP Message

                at org.switchyard.component.soap.OutboundHandler.handleMessage(OutboundHandler.java:177) [switchyard-component-soap-0.8.0-SNAPSHOT.jar:0.8.0-SNAPSHOT]

                ....

            Caused by: javax.xml.soap.SOAPException: Unable to create SOAP Body due to null message content

                at org.switchyard.component.soap.composer.SOAPMessageComposer.decompose(SOAPMessageComposer.java:140) [switchyard-component-soap-0.8.0-SNAPSHOT.jar:0.8.0-SNAPSHOT]

                at org.switchyard.component.soap.composer.SOAPMessageComposer.decompose(SOAPMessageComposer.java:55) [switchyard-component-soap-0.8.0-SNAPSHOT.jar:0.8.0-SNAPSHOT]

                at org.switchyard.component.soap.OutboundHandler.handleMessage(OutboundHandler.java:140) [switchyard-component-soap-0.8.0-SNAPSHOT.jar:0.8.0-SNAPSHOT]

                ... 162 more

             

            I have been debugging a bit and can verify that the message probably contains a null body. In ExchangeImpl.send, I can see that message._content.node contains [imex:test: null]. Now my problem is that as far as I can tell, this is correct; for comparison, here's the corresponding SOAP message generated by soapUI from the relevant WSDL:

             

            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:imex="http://imexmock.esb.swr.ard.de/">

               <soapenv:Header/>

               <soapenv:Body>

                  <imex:test/>

               </soapenv:Body>

            </soapenv:Envelope>

             

            Meaning, I don't know what I'm supposed to be putting into the body, I'm calling a parameterless SOAP function and would expect it to work. Do you have any insights into what might be going wrong?

             

            Just to make sure, I tried defining the following Transformer (which gets picked up by the SwitchYard tooling just fine), but to no avail:

             

            @Transformer(to = "{http://imexmock.esb.swr.ard.de/}test")

            public Element transformVoidToElement(Object obj) {

                StringBuilder ackXml = new StringBuilder()

                .append("<imex:test/>");

                return toElement(ackXml.toString());

            }

             

            The transformer didn't make any differences to the processing of my call. Thanks for any suggestions on what to try next!

            • 18. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
              dward

              Per your comments above, I thought you were passing integers?  No matter, we can work through this.  Do you think you could zip up a sample project demonstrating this and attach it to this thread? It would be easier for us to figure out if we could see the whole picture from end-to-end.  Thanks!

              • 19. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                andi.scharfstein

                Sorry for the confusion - I am passing in no parameters but I am returning integers. The process seems to halt at call stage already though, so I never even get to integer processing.

                 

                I have zipped and uploaded my current project, it consists of two parts: The service to be called (called ImexMockCXF) and the SwitchYard project doing the calling (called bpm-soap). The expectations are that the service is deployed on localhost:8080, so far I have been using a Tomcat server and running a JBoss Server in parallel on port 8180 - using the same server is of course feasible as well, not sure of it will deploy out-of-the-box, though. Thanks for your willingness to take a look!

                • 20. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                  ubm

                  David,

                   

                  I'm using the 0.8.0-SNAPSHOT source code now. Debugging works fine.

                  For example, in "Method.class:invoke" I can monitor the params sent by a call to your bpm-sample via SoapUI:

                   

                  <orderId>60</orderId>

                  <itemId>cowbell</itemId>

                  <quantity>1000</quantity>

                   

                  However I'm not able to create a suitable object (from inside the bpm workflow) which can be sent to the SwitchYard service task I have defined:

                   

                   

                  bpm2.png

                  All I get is: "Unable to create SOAP Body due to null message content"!

                   

                  The signature of my external soap service is "String fnc(String)".

                   

                  How can I define a simple string content for sending it to the soap service

                  and how can I store the returned string result in a global var?

                   

                  (

                  In other words: Where in the switchyard code will this be created (a sample soap call to my external soap service)?

                  Probably a transformer?!


                  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:esb="http://esb">

                     <soapenv:Header/>

                     <soapenv:Body>

                        <esb:mySoapServiceTest>

                           <esb:test>SOME TEXT</esb:test>

                        </esb:mySoapServiceTest>

                     </soapenv:Body>

                  </soapenv:Envelope>

                  )

                   

                   

                  Thank You.

                   

                   

                  PS: Creating transformers in Java or JAXB is detected by SwitchYard and is shown under

                  switchyard.xml -> properties -> transformers ... so this seems to work well.

                  • 21. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                    dward

                    Uwe, can you please provide a couple pastebin links, one to your complete (generated in target/classes/META-INF) switchyard.xml, as well as your complete WSDL for your external service? Thanks.

                    • 22. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                      dward

                      Thanks, Andi. I've downloaded your project and should be able to look at it tomorrow.

                      • 23. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                        ubm

                        switchyard.xml

                        http://pastebin.com/TVFWkXDP

                         

                        TestSoapService.wsdl (wsdl for external soap service)

                        http://pastebin.com/uurPnN15

                        • 24. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                          dward

                          Andi, I wasn't able to run your example fully, as my environment is not set up propertly to run your external web service (perhaps if you gave me a link to the pre-built war)... But anyway, I think I know what the problem is:

                          • SwitchYard's BPMExchangeHandler is what handles the output from the executed bpm process (and thus, the executed external web service), and sets the content of the output message based on what it gets back (see Line 277). However, what I believe is happening is that the content is never set, so it is null, which is causing the SOAPMessageComposer to throw your exception (see Line 140).  The reason for this appears to be that you are not mapping your output variables - neither in the process itself, nor in the SwitchyardService task.  You need to:
                            1. Click on the background of your bpm-soap.bpmn process, go to Data Items, then define a Process variable of "contentOutput".
                            2. Click on your SwitchYardService Task ("Task 1"), go to I/O Parameters, and define a new Output Paramater, whos Name is "contentOutput", and a Mapped To of ImexAdapterBPM/contentOutput (the process-level variable)
                          • Can you try the above and let me know how it goes?  If it still doesn't work, I'll need that war file...
                          • Aside, I did notice two other things in perusing your project, neither of which would cause your problem, but just FYI:
                            1. You no longer have to register a SwitchyardServiceWorkItemHandler in 0.8.0-SNAPSHOT.  The BPM Component runtime does it automatically for you now.
                            2. When I build your bpm-soap project, the drools/jbpm/kie libraries that are being pulled down are of version 6.0.0-SNAPSHOT.  I honestly don't know why it's doing this, as in your pom you don't override anything, and we specify it in our switchyard-component-bpm project to be 6.0.0.Alpha6. Kinda weird...
                          • 25. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                            andi.scharfstein

                            David,

                            many thanks for the detailed analysis - I'll try to implement your suggestions first thing tomorrow and will report back with the results, but let me just say that this sounds very promising already

                            • 26. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                              dward

                              Uwe, considering that your error message is exactly the same as Andi's, please help me out with something before I go too deep into this.  Specifically, make sure that you are properly mapping the contentOutput in your SwitchYardService task and in your process variables too.  To do this, check out the 2 steps I listed for Andi here.  Once you do that, if you still have a problem, then a new/latest/greatest zipped-up version of your project would be appreciated.

                              • 27. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                                andi.scharfstein

                                David,

                                I tried implementing your suggestion but unfortunately did not observe output any different from what I've seen before. Maybe I didn't do it correctly (although I followed your instructions to the letter), but I think the best way of checking this would be to give you access to the WAR. Here you go: http://synchron.org/download/ImexMockCXF.war

                                Apologies for the complications, but I really am at my wit's end here. Thanks for your support!

                                • 28. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                                  dward

                                  Andi,

                                   

                                  I was able to get your example working after a few changes:

                                  1. I had to edit the bpm-soap.bpmn file in the ways I described above, mapping contentInput and contentOutput.
                                  2. I had to change your Imex.java interface to include a "start" method in addition to the "test" method, and fix up the signatures to match what's in the WSDL.  Considering you are using the same interface for both executing switchyard (via "start"), and for executing the remote web service (via "test"), you need both methods on your interface.
                                  3. I had to change your switchyard.xml from this: <action type="START_PROCESS"/> to this: <action operation="start" type="START_PROCESS"/>.  Without an operation, it won't map to anything! (Well, it will. It will map to "default", but that's not what's in your interface.)

                                   

                                  Notes:

                                  • I did run Tomcat 7 and SwitchYard+AS7 side-by side, and with message tracing on in switchyard, I saw output there, as well as the output by tailing tomcat's log file.  I used soapui to verify the round-trip gave me the reponse I was looking for.
                                  • I will attach my changes.  You can peruse them yourself.  Note that I did change ports up, however (tomcat=9090, jboss/switchyard=8080).

                                   

                                  David

                                  • 29. Re: SwitchYard service task ... calling soap service with no errors, but no reaction
                                    dward

                                    Andi, here's the working example: bpm-soap_GOOD.zip