0 Replies Latest reply on Jul 25, 2017 9:41 AM by chintan_jboss

    Can i have One Java Interface for multiple switchyard services (bean)?

    chintan_jboss

      Hi,

       

      I have one java interface with process method which i want to use for two different Service beans in Switchyard. is there a way to do it?

       

      <sca:service name="Service1" promote="Service1/ServiceInterface">
            <sca:interface.java interface="org.foo.service.ServiceInterface"/>
            <http:binding.http>
              <sy:operationSelector operationName="process"/>
              <http:messageComposer class="org.foo.service.CustomHttpMessageComposor"/>
              <http:contextPath>/getDataForService1</http:contextPath>
            </http:binding.http>
          </sca:service>
          <sca:component name="Service1">
            <implementation.bean class="org.foo.service.Service1"/>
            <sca:service name="ServiceInterface">
              <sca:interface.java interface="org.foo.service.ServiceInterface"/>
            </sca:service>
          </sca:component>
          <!--service2 -->
        <sca:service name="Service2" promote="Service2/ServiceInterface">
            <sca:interface.java interface="org.foo.service.ServiceInterface"/>
            <http:binding.http>
              <sy:operationSelector operationName="process"/>
              <http:messageComposer class="org.foo.service.CustomHttpMessageComposor"/>
              <http:contextPath>/getDataForService2</http:contextPath>
            </http:binding.http>
          </sca:service>
          <sca:component name="Service2">
            <implementation.bean class="org.foo.service.Service2"/>
            <sca:service name="ServiceInterface">
              <sca:interface.java interface="org.foo.service.ServiceInterface"/>
            </sca:service>
          </sca:component>