Wednesday, August 26, 2015

Using Validate Mediator with source defined

In WSO2 ESB, you can use validate mediator to define your custom xsd, and validate the input you are getting. If it doesn't comply to the given xsd, you can execute a custom flow and send a fault message. Most examples available is where you don't define the source property so that the first child of the SOAP request will be evaluated. This is just a sample proxy that shows how you can add the xpath to source property.

<proxy xmlns=""
         <log level="full">
            <property name="Message" value="Inside Insequance"/>
         <validate xmlns:nfs=""
            <schema key="conf:/validateCustomer.xsd"/>
               <log level="custom">
                  <property name="MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
               <makefault version="soap11">
                  <code xmlns:tns="" value="tns:Receiver"/>
                  <reason value="Invalid request received"/>
               <property name="RESPONSE" value="true"/>
               <header name="To" expression="get-property('ReplyTo')"/>

A sample request for above would be like,
<soapenv:Envelope xmlns:soapenv="" xmlns:nfs="">
<nfs:CustomerReq  xmlns:nfs="">

Finally you can add your xsd file to mentioned location in schema key. (Under browse->resources->config ->add resource)

Friday, August 21, 2015

Common issues when creating API Manager cluster

There are some common issues faced when users create WSO2 API manager clusters. Here are some points you could follow when troubleshooting.

1.  Make sure all relevant nodes are added in each others' axis2.xml cluster members. For example, if you have 4 Gateway nodes (2 Managers and 2 Workers) you need to make sure that you add all other members under cluster members (axis2.xml) , so that all the nodes are synced up. If this is not done properly, you might come across issues where some of your nodes are not updated with all changes.(Missing apis,missing edits done for apis)

You can check if all nodes are getting synced properly , by checking repository/deployment/server/synapsconfig/default/apis   sections of each node and see if all published APIs are listed.

2.  When you are fronting gateway nodes with a load balancer, your publisher/store node's api-manager.xml should point to the load balancer url.

3. When you are installing an external key manager (WSO2 Identity Server) , make sure that you set the url of IS, in <APIKeyManager> section of api-manager.xml.

Installing features in WSO2 products

When you are installing features in WSO2 products, make sure you look into following matrix. So that you can identify the supported platform version and related product version.