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>
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.
Related
Using a client/server Infinispan implementation, the write operations use Protobuf serialization, but the load operation is using the java serializer. How can I configure the load to use the Protobuf serialization?
Here is the server and cache config:
<cache-container name="default" statistics="true">
<transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
<security>
<authorization/>
</security>
</cache-container>
<cache-container name="operationnproto" statistics="true">
<serialization>
<context-initializer class="com.bskyb.infinispan.datastores.BookSchemaImpl"/>
</serialization>
<distributed-cache name="distributedCache-operationnproto" owners="2" capacity-factor="1">
<encoding media-type="application/x-protostream"/>
<persistence>
<store class="com.bskyb.infinispan.datastores.BookCacheStore">
<property name="lbCassandraCluster"></property>
<property name="lbCassandraPort"></property>
<property name="lbCassandraDatacenter">datacenter1</property>
</store>
</persistence>
</distributed-cache>
I am using WSO2 ESB to send a POST request to a Rest API of mine.
actually, the API returns a 201 status with some data.
The API itself using POSTMAN works perfectly, but a 202 accepted response is return using the ESB link
here's my implementation:
the POST API Link:
http://mysite/sites/4/floors/4/pois/12/prelock
My ESB API :
<resource methods="POST" uri-template="/sites/{siteId}/floors/{floorId}/pois/{poiId}/prelock">
<inSequence>
<log level="full"/>
<header name="Content-Type" scope="transport" value="application/json"/>
<property expression="$axis2:HTTP_SC" name="Status" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<send>
<endpoint key="NodeRedPrelock"/>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
<faultSequence/>
</resource>
endpoint :
<endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse">
<http method="post" uri-template="http://mysite/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/>
The problem seems to be with the http method .Can you try with this
<endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse">
<http trace="disable" uri-template="http://169.46.25.33:1880/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/>
</endpoint>
Are you check your sequence in Carbon interface?
Some times when you deploy car to esb carbon remove endpoint from "send" tag.
Or it's seems as problem in endpoint. You can try resave endpoint in interface. Sometimes I have problem after deploy car file and endpoint don't work until make save by hand.
I followed the link ESB as a JMS Producer to configure the sender and receiver. I have also placed the following jars activemq-broker-5.8.0.jar activemq-client-5.8.0.jar activemq-kahadb-store-5.8.0.jar
geronimo-jms_1.1_spec-1.1.1.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jta_1.0.1B_spec-1.0.1.jar hawtbuf-1.9.jar Slf4j-api-1.6.6.jar activeio-core-3.1.4.jar into WSO2_EI_HOME/lib
When I configured a proxy with the following code and tried to send the messages to the queue, but the messages aren't delivering.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Sender"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/VALLYSOFTQ?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
The same configuration worked earlier for me but I don't know what happened, the messages are not going to the queue now.
Thanks in advance.
I'm trying to expose an internal REST implementation via wso2.
here's the API definition
<api xmlns="http://ws.apache.org/ns/synapse" name="API" context="/api" hostname="http://toto.com" port="80">
<resource methods="POST GET" uri-template="/{methodName}">
<inSequence trace="disable">
<send>
<endpoint>
<http uri-template="http://toto.com/1.0.1/api/{uri.var.methodName}" method="GET|POST|PUSH|PUT|DELETE"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</resource>
</api>
I'm only tying to relay the methodName.
I'm pretty new to wso2, still I can't find what's wrong here ?
Thanks for any help or links.
Well I had to remove port and hostname from the api definition in order to make it work.
Not sure why but if it can help
i have a custom proxy in WSO2 ESB 4.7 works correct.
But, when i copy to ESB 4.8.1 it's fail.
This is te code.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse"
name="ExpertWS"
transports="http"
statistics="disable"
trace="enable"
startOnLoad="true"> <target>
<inSequence>
<log level="full"/>
<send>
<endpoint>
<http uri-template="http://1.33.33.103:8080/erpws/logistica/master/ume/{pEmpresa}"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence> </target> <description/> </proxy>
Any idea??
Thanks
In a http endpoint, properties names must start with "uri.var" : uri.var.pEmpresa and a value must be set
see https://docs.wso2.org/display/ESB481/HTTP+Endpoint