Pergunta

Is there an API for WSO2 API Manager that I can consume? As in say, get a list of the API's or whatever. I heard there is a SOAP API for this, but I cannot find anything about it. I'm hoping someone has got some information. I found this XML file (listed below) that may or may not be what I need but I'm a total noob when it comes to SOAP and don't know of this what I need. Here's the file contents. Is this what a WSDL file would look like?

<?xml version="1.0" encoding="UTF-8"?><serviceGroup name="API" successfullyAdded="true">
    <service name="API" exposedAllTransports="true" serviceDeployedTime="1347567758279" successfullyAdded="true">
        <operation name="getAPI">
            <parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/list</parameter>
            <module name="addressing" version="4.0" type="engagedModules"/>
            <module name="relay" version="4.0" type="engagedModules"/>
        </operation>
        <operation name="updateAPI">
            <parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/add</parameter>
            <module name="addressing" version="4.0" type="engagedModules"/>
            <module name="relay" version="4.0" type="engagedModules"/>
        </operation>
        <operation name="getAPIDependencies">
            <parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/list</parameter>
            <module name="addressing" version="4.0" type="engagedModules"/>
            <module name="relay" version="4.0" type="engagedModules"/>
        </operation>
        <operation name="addAPI">
            <parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/add</parameter>
            <module name="addressing" version="4.0" type="engagedModules"/>
            <module name="relay" version="4.0" type="engagedModules"/>
        </operation>
        <operation name="getAPIArtifactIDs">
            <parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/list</parameter>
            <module name="addressing" version="4.0" type="engagedModules"/>
            <module name="relay" version="4.0" type="engagedModules"/>
        </operation>
        <operation name="deleteAPI">
            <parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/add</parameter>
            <module name="addressing" version="4.0" type="engagedModules"/>
            <module name="relay" version="4.0" type="engagedModules"/>
        </operation>
        <bindings>
            <binding name="APISoap12Binding">
                <operation name="getAPI"/>
                <operation name="updateAPI"/>
                <operation name="getAPIDependencies"/>
                <operation name="addAPI"/>
                <operation name="deleteAPI"/>
                <operation name="getAPIArtifactIDs"/>
            </binding>
            <binding name="APIHttpBinding">
                <operation name="getAPI"/>
                <operation name="updateAPI"/>
                <operation name="getAPIDependencies"/>
                <operation name="addAPI"/>
                <operation name="deleteAPI"/>
                <operation name="getAPIArtifactIDs"/>
            </binding>
            <binding name="APISoap11Binding">
                <operation name="getAPI"/>
                <operation name="updateAPI"/>
                <operation name="getAPIDependencies"/>
                <operation name="addAPI"/>
                <operation name="deleteAPI"/>
                <operation name="getAPIArtifactIDs"/>
            </binding>
        </bindings>
        <policies/>
        <module name="addressing" version="4.0" type="engagedModules"/>
        <module name="relay" version="4.0" type="engagedModules"/>
        <parameter name="enableMTOM">true</parameter>
        <parameter name="adminService">true</parameter>
        <parameter name="AuthorizationAction">/permission/admin/login</parameter>
        <parameter name="hiddenService">true</parameter>
    </service>
</serviceGroup>
Foi útil?

Solução

Yes,there's a javascript API layer built with Jaggery which can be used to consume API Manager related functionalities in a REST way.

Currently,you can find them inside the two jaggery applications [store/publisher] with following location.Navigate to it,and you'll notice there are several sub-directories inside 'blocks' directory according to the terms that api manager related functionalities catogorized [eg:item-add,listing,search,etc].Open the reuired catogory and there will be a sub folder called 'ajax' since we are passing requests in AJAX way.Inside that you can find the jag file which contains the relevant API methods that can be consume in a REST way.

Yet we have not separate this API layer from the web-application flow to make a user easy to find and consume the API,but we are planning to add this API layer separate in to the apps in near future.

For the moment,what you can do is just go to the above mentioned location,and find the relevant API method to consume.Say for an example if you want to consume addAPI method in api-publisher,what you can do is navigate to 'ajax' sub-directory of'item-add' directory in the location .You'll see there's a file called 'add.jag'.Open it and identify what is the action[eg:addAPI] and what are the request parameters[eg:APIName,version,etc] you need to pass to process the action.Then send http request to the API function by using a REST client.[eg:CURL].For example here your http request will be following way.

"http://ip:port/publisher/site/blocks/item-add/ajax/add.jag -d "action=addAPI&name=API1&version=1.0.0&description=API&endpoint=http://search.twitter.com&wsdl=&tags=open,social&tier=Silver&thumbUrl=https://lh6.ggpht.com/RNc8dD2hXG_rWGzlj09ZwAe1sXVvLWkeYT3ePx7zePCy4ZVV2XMGIxAzup4cKM85NFtL=w124&context=/api2&tiersCollection=Gold&resourceCount=0&resourceMethod-0=POST&uriTemplate-0=/*";"

You can find three samples[TwitterSearch,YahooPlaceFinder,YoutubeFinds] written based on this JavaScript layer from the below location of your downloaded pack. {API Manager HOME}/samples

Navigate to each three above samples inside the above location and have a look on APIPopulator.sh script,to get better understanding how the API Manager related jaggery API has been consumed from those.

Adding to above,for WSO2 API Manager implementation of its back-end major functionalities we have not used web-service invocations but a java API which can be found from here.You can use that API to do your custom implementations.You can find our java[back-end] implementation from this java API from here.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top