4 Replies Latest reply on Nov 19, 2014 12:04 PM by kunalsuri

    FSW switchyard project supporting only one arguments

    kunalsuri

      Hello Folks,

       

      Greetings!

       

      I have been testing some dummy soap services inside switchyard project and I was receiving some error like "Unresolvable Service Interface: The specified interface does not exist on the project classpath. switchyard.xml" sometimes.

       

      This was happening when I was creating a service with operation having more than 1 input argument. Initially, I though it to be some error at my side (configuration etc) but then I googled it to find that switchyard is supporting only one argument. (Similar to Re: Re: Fresh Start Project SwitchYard problems )


      Thus, I wanted to ask the following questions:

       

      1.) Is this mulit-argument support problem only for previous versions (like I am using 1.1.1-p5-redhat-1) and would the later upcoming versions of switchyard support multi- arguments?


      2.) How should I create a webservice using switchyard project that should except multi-arguments input? Could you please point me towards some documents or some examples?

       

      Thanks!

      Kunal.

        • 1. Re: FSW switchyard project supporting only one arguments
          sarathksnair

          Hi Kunal,

           

          We can pass object of the request class rather creating individual arguments.

           

          for example if you have name age and id as 3 elements in the soap request create the object of the request class where you will have the setters and getters of these elements and pass the elements to the interface as an object of this class.

           

          Interface class:

          ============

          public interface Employee(Request obj)

          {

               void display();

          }

           

          Request class:

          ============

          public class Request

          {

               String name;

               int age,id;

           

          public String getName() {

              return name;

               }

           

          public void setName(String name) {

              this.name = name;

               }

           

          public int getAge() {

              return age;

               }

           

          public void setAge(int age) {

              this.age = age;

               }

           

          public int getId() {

              return id;

               }

           

          public void setId(int id) {

              this.id = id;

               }

          }

           

          now the object of this class will hold all the three elements u want to pass from soap.

          hope you understood....

           

           

          Thanks

           


           

          • 2. Re: FSW switchyard project supporting only one arguments
            kunalsuri

            Thanks for the answer and effort Sarath!

             

            Also, I got your point correctly and I did have some idea of what you said. But the main issue because of which I wanted to see a full working example of mulit-arguments was because I am not able to properly use the object in the Transformation class.

             

            I am getting a null value because I do not know how to handle the transformer class like:

            @Transformer(from = "{urn:com.example.switchyard:switchyard-example-employe_details:1.0}employee_type")

             

            Could you please provide me with some insight on the Transformer Class?

             

            Cheers!

            Kunal.

            • 3. Re: FSW switchyard project supporting only one arguments
              sarathksnair

              Hi Kunal,

               

              I thought you wanted to know how to pass multiple arguments from webservice.

               

              I hope you are trying to invoke webservice using javabean component in Switchyard project.

               

              In that case, while promoting a service itself the editor will ask for the creation of transformer class, you can proceed with selecting the Java transformer class. So by default the transformer class will give you with the from and to part in the transformer class. Now in the "@Transformer from" u can use the objects of the service to be called and then assign the values here, and thus pass the values to that service using the transformer. I guess you know how to create the object of the service to be consumed. This service will then perform all the logic and returns the control over to "@Transformer to". Here you need to paste the actual response payload hardcoded with the response body you have from the response element in the consumed service.

               

              I am just giving an overview of the flow. I hope this will clarify your query.

               

              Please refer:: http://www.mastertheboss.com/soa-cloud/jboss-soa/switchyard-tutorial  and

                                  http://www.mastertheboss.com/soa-cloud/jboss-soa/switchyard-tutorial?showall=&start=1

               

              Thanks

               

              1 of 1 people found this helpful
              • 4. Re: FSW switchyard project supporting only one arguments
                kunalsuri

                Hi Sarath,

                 

                Thanks for the Tutorial link. It was a great help.

                 

                It helped me figure out my problem and now I am able to pass multi-arguments and use the Transformation Class with out SOAP error messages.

                 

                Cheers!

                Kunal.