0

I'm trying to deploy an API in WSO2 ESB automatically. I put .xml file with de API and its resources definition in {ESB_HOME}/repository/deployment/server/synapse-configs/default/api/ and the API Factory from ESB deploy it.

But I get this error:

[2015-04-29 11:19:18,013] ERROR - APIFactory An API must contain at least one resource definition [2015-04-29 11:19:18,017] ERROR - APIDeployer API deployment from the file : /home/sergio/Escritorio/wso2esb-4.8.1/repository/deployment/server/synapse-configs/default/api/prueba.xml : Failed. org.apache.synapse.SynapseException: An API must contain at least one resource definition

The xml definition is:

<?xml version="1.0" encoding="UTF-8"?><api name="apps" context="/services/services/app"><resource methods="GET" uri-template="/get/{codigoApp}"><inSequence><send><endpoint><http method="get" uri-template="http://localhost:8080/services/services/app"/></endpoint></send></inSequence></resource><resource methods="GET" uri-emplate="/getAll"><inSequence><send><endpoint><http method="get" uri-template="http://localhost:8080/"/></endpoint></send></inSequence>    </resource></api>

And I can deploy this api definition in managment panel in WSO2 ESB.

Any idea?

Thanks, Sergio.

Community
  • 1
  • 1
Sergio Rodríguez Calvo
  • 1,183
  • 2
  • 16
  • 32

1 Answers1

1

Create a file with apps.xml and drop that file into ESB_HOME/repository/deployment/server/synapse-configs/default/api

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse"
     name="apps"
     context="/services/services/app">
   <resource methods="GET" uri-template="/get/{codigoApp}">
      <inSequence>
         <send>
            <endpoint>
               <http method="get" uri-template="http://localhost:8080/services/services/app"/>
            </endpoint>
         </send>
      </inSequence>
   </resource>
   <resource methods="GET">
      <inSequence>
         <send>
            <endpoint>
               <http method="get" uri-template="http://localhost:8080/"/>
            </endpoint>
         </send>
      </inSequence>
   </resource>
</api>
Vanji
  • 1,696
  • 14
  • 23