How to route by call method in proxy with WSO2?

273 views Asked by At

I want to route process in proxy by call method name. I must get only allowable methods from web services. For example, webService1 has a(), b(), c() methods. webService2 has d(), e() methods. I want to get only a(), b() and d() methods for client. So, I must get request method to do this. I can do it by soap action property like this:

         <property name="MY_SOAP_ACTION"
                   expression="get-property('Action')"
                   scope="default"
                   type="STRING"/>
         <switch source="get-property('MY_SOAP_ACTION')">
            <case regex="add">
               <send>
                  <endpoint>
                     <address uri="http://localhost:1111/MockService1?wsdl"/>
                  </endpoint>
               </send>
            </case>
            <case regex="sgrsControlInspection">
               <send>
                  <endpoint>
                     <address uri="http://localhost:2222/MockService2?wsdl"/>
                  </endpoint>
               </send>
            </case>

But web services belong to another foundations and the methods haven't soap action annotation. So how can I do this without action property?

1

There are 1 answers

0
Ravindra Ranwala On

The SOAP action yields the method that you want to call in the end point. It does not need to have annotations specified. The way you have done seems correct. Also please remove the '?wsdl' part from the end point. Your end point configuration should be corrected as follows.

<address uri="http://localhost:1111/MockService1"/>

Other configurations seems fine.