1 2 3 Previous Next 39 Replies Latest reply on May 24, 2016 10:53 AM by j_ri Go to original post
      • 30. Re: need a web service proxy quickstart in SwitchYard
        alanchen

        That sounds good. BTW when the SwitchYard team updates this function in the next version 0.4. All of us hope the SwitchYard team could update the quickstart with new configuration as well.  So that the newbie can learn it easily. Thanks Keith.

        • 31. Re: need a web service proxy quickstart in SwitchYard
          alanchen

          Hi Magesh,

           

          Currently, I use another proxy (ProxyService2) to support the MathService. You may see the attachment in detail. But I just want to use ProxyService only to support both HelloService and MathService at the same time. Do you know it is possible for SwitchYard to support this function or not? I hope I can get your help.

           

          Best Regards!

          Alan

          • 32. Re: need a web service proxy quickstart in SwitchYard
            mageshbk

            Yes it is possible. Here is the snippet for it.

            <sca:composite name="camel-soap-proxy" targetNamespace="urn:switchyard-quickstart:camel-soap-proxy:1.0">
                <sca:service name="ProxyService" promote="ProxyService">
                    <soap:binding.soap>
                        <swyd:contextMapper/>
                        <soap:wsdl>META-INF/HelloService.wsdl</soap:wsdl>
                        <soap:socketAddr>:18002</soap:socketAddr>
                    </soap:binding.soap>
                </sca:service>
                <sca:reference name="HelloService" promote="HelloService" multiplicity="0..1">
                    <soap:binding.soap>
                        <swyd:contextMapper/>
                        <soap:wsdl>http://localhost:8080/HelloService/servlet/helloService?wsdl</soap:wsdl>
                    </soap:binding.soap>
                </sca:reference>
                <sca:reference name="MathService" promote="MathService" multiplicity="0..1">
                    <soap:binding.soap>
                        <swyd:contextMapper/>
                        <soap:wsdl>http://localhost:8080/MathService/servlet/mathService?wsdl</soap:wsdl>
                    </soap:binding.soap>
                </sca:reference>
                <sca:component name="ProxyService">
                    <camel:implementation.camel>
                        <spring:route>
                            <spring:to uri="switchyard://HelloService"/>
                        </spring:route>
                    </camel:implementation.camel>
                    <sca:service name="ProxyService">
                        <sca:interface.java interface="org.switchyard.quickstarts.camel.soap.proxy.HelloService"/>
                    </sca:service>
                    <sca:reference name="HelloService">
                        <sca:interface.java interface="org.switchyard.quickstarts.camel.soap.proxy.HelloService"/>
                    </sca:reference>
                    <sca:reference name="MathService">
                        <sca:interface.java interface="org.switchyard.quickstarts.camel.soap.proxy.MathService"/>
                    </sca:reference>
                </sca:component>
            </sca:composite>
            
            

             

            But how you will route the incoming message to the appropriate WS is dependent on implementation that you decide on. Notice the uri="switchyard://HelloService" above. If we can have dynamic route in SwitchYard Camel component is not what I am sure of.

            • 33. Re: need a web service proxy quickstart in SwitchYard
              kcbabo

              But how you will route the incoming message to the appropriate WS is dependent on implementation that you decide on. Notice the uri="switchyard://HelloService" above. If we can have dynamic route in SwitchYard Camel component is not what I am sure of.

               

              Alan - can you provide some more detail on how you want to handle the routing to HelloService and MathService?  Just describe the behavior you're looking for and we can answer with how it should be implemented.  Do you want requests to be broadcast to both services?  Should it be depdendent on the content of the message?  etc.

              • 34. Re: need a web service proxy quickstart in SwitchYard
                alanchen

                Thanks Magesh, I should give you more information as following.

                • 35. Re: need a web service proxy quickstart in SwitchYard
                  alanchen

                  the scenario is like this.

                   

                  • There is a WS which is located in different areas. One is located in Sigapore; the other is in US.
                  • Clients send their requests to WS proxy with soap message. In the soap message, there is a element (called "location") which value will be "Sigapore" or "US".
                  • When WS proxy gets the request from clients and parses the content in "location" element in soap message. If the valuse of the "location" element is "Sigapore", WS proxy will forward this request to Sigapore Server. If the valuse of the "location" element is "US", WS proxy will forward the request to US Server.  so I think there are two back end web services within one WS proxy in SwitchYard.

                   

                  Regards!

                  • 36. Re: need a web service proxy quickstart in SwitchYard
                    kostas_papag

                    Hello ,

                     

                    I recently started using switchyard. going through quickstarts seems quite helpful to get used with the system.

                    I'm interesting in creating a SOAP proxy. I'm following the pattern of the above discussed example( soap camel route proxy). However my service has more than one method and as a result i get errors of type : "No operationSelector was configured for the Camel Component and the Service Interface contains more than one operation".

                     

                    I noticed that for horneq, camel, http,jca bindings there is an operationSelector available. Is there some similar support in case of SOAP binding?

                     

                    Regards

                    • 37. Re: need a web service proxy quickstart in SwitchYard
                      igarashitm

                      Hi Kostas,

                       

                      Could you try this?

                       

                      --- a/camel-soap-proxy/src/main/resources/META-INF/switchyard.xml
                      +++ b/camel-soap-proxy/src/main/resources/META-INF/switchyard.xml
                      @@ -22,6 +22,9 @@
                               <sca:component name="ProxyService">
                                   <camel:implementation.camel>
                                       <spring:route>
                      +                    <spring:setHeader headerName="operationName">
                      +                        <spring:simple>${header.org.switchyard.operationName}</spring:simple>
                      +                    </spring:setHeader>
                                           <spring:to uri="switchyard://ReverseService"/>
                                       </spring:route>
                                   </camel:implementation.camel>
                      
                      

                       

                      Thanks,

                      Tomo

                      • 38. Re: need a web service proxy quickstart in SwitchYard
                        kostas_papag

                        Tomohisa igarashi wrote:

                         

                        Hi Kostas,

                         

                        Could you try this?

                         

                        --- a/camel-soap-proxy/src/main/resources/META-INF/switchyard.xml
                        +++ b/camel-soap-proxy/src/main/resources/META-INF/switchyard.xml
                        @@ -22,6 +22,9 @@
                                 <sca:component name="ProxyService">             <camel:implementation.camel>                 <spring:route>+                    <spring:setHeader headerName="operationName">+                        <spring:simple>${header.org.switchyard.operationName}</spring:simple>+                    </spring:setHeader>                     <spring:to uri="switchyard://ReverseService"/>                 </spring:route>             </camel:implementation.camel>
                        

                         

                        Thanks,

                        Tomo

                         

                        I tried it and yes, works like a charm!

                        Setting the operationName in the header of the message seems to be enough for switchyard to route the message in a proper way.

                         

                        The exception that i was getting :

                         

                        org.switchyard.exception.SwitchYardException: No operationSelector was configured for the Camel Component and the Service Interface contains more than one operation

                        lead me to think that the only way to go was to use operationSelector, but as it seems it is not necessary.

                        Thanks!

                        • 39. Re: need a web service proxy quickstart in SwitchYard
                          j_ri

                          I had this problem today but the workaround didn't work for me.

                          After debugging and playing around, I found out that the workaround (with SY 2.0.1) looks like this:

                                  <setHeader headerName="operationName" id="route_setHeader1c">
                                      <simple>${exchangeProperty[org.switchyard.operationName]}</simple>      
                                  </setHeader>
                          
                          1 2 3 Previous Next