Posts

Showing posts from November, 2012

TIP: Error handling in WSO2 ESB APIs when the requested API resource does not match with the given URL template or pattern

When you send a HTTP request to an API in WSO2 ESB , if the requested API resource URL does not comply with the API resource definition, ESB returns HTTP 202 accepted response to the user. Due to  this behavior, the client is unable to distinguish if they have made an error. We can use the following procedure to return a fault to the client in case of non-matching API resource is requested by client. Step 1: Suppose, we have an API similar to the following. Note that, the target web service is a JAXRS web application (jaxrs_basic) which is included in WSO2 Application Server by default. <api xmlns="http://ws.apache.org/ns/synapse" name="jaxrs" context="/jaxrs"> <resource methods="GET" uri-template="/customers/{id}"> <inSequence> <send> <endpoint> <address uri="http://localhost:9764/jaxrs_basic/services/customers/customerservice"/> ...

How to enable mail transport for WSO2 data services

Image
We can use mail transport to send and receive messages to and from web services using MIME complaint mail messages. We can configure mail transport for Axis2 services which are deployed in WSO2 Application Server by following the instructions given in the official documentation . In there, you will notice that, a set of mail transport specific parameters need to be configured in the services.xml of Axis2 service in order to enable mail transport in Axis2 services. How can we do the same for data services which are deployed in WSO2 Application Server? This post summarizes the procedure of configuring mail transport for a data service. Step 1: Download and install WSO2 Application Server-5.0.0 or a later version. Configure mail transport sender and receiver in axis2.xml configuration file which can be found at CARBON_HOME/repositiry/conf/axis2/axis2.xml (see WSO2 Application Server official documentation on how to configure mail transport sender and receiver in axis2.xml) Aft...