Hi Udara, We need to remove NO_ENTITY_BODY property if we want to generate a response from the ESB itself to a request without an entity body, for example, GET request. According to commit[1], NO_ENTITY_BODY property programmatically removed from the code as an improvement in PayloadFactory mediator. Therefore no need to add property[1] if we are using payload factory mediator in synapse configurations.
[1]. <property name="*NO_ENTITY_BODY*" action="remove" scope="axis2"/> Thanks. On Thu, Jul 28, 2016 at 2:29 PM, Udara Liyanage <[email protected]> wrote: > Hi, > > According to [1], NO_ENTITY_BODY property is set if the client want to get > response with entities for requests which does not have an entity body such > as GET and DELETE. > > 1) My first question according to [1] by default ESB will not send a > response for requests without body. That is OK for DELETE, but how about > GET. GET are supposed to get a response. > > 2) I have below api definition. with a simple GET which generates a simple > response. > I get a response for GET even I do or don't remove NO_ENTITY_BODY > property. Behavior is same for DELETE too. > > <api xmlns="http://ws.apache.org/ns/synapse" name="GetTickets" > context="/tickets"> > <resource methods="GET" url-mapping="/"> > <inSequence> > <payloadFactory media-type="json"> > <format>{"fname":"udara","lname":liyanage""}</format> > <args/> > </payloadFactory> > <respond/> > </inSequence> > </resource> > </api> > > *Request and response* > curl -X GET -H "Authorization: Token" "http://localhost:8280/tickets/" > {"name":"udara","age":"10"} > > [1] > https://docs.wso2.com/display/ESB403/HTTP+Transport+Specific+Properties > -- > > Udara Liyanage > Software Engineer > WSO2, Inc.: http://wso2.com > lean. enterprise. middleware > > Blog: http://udaraliyanage.wordpress.com > -- Vijitha Ekanayake Software Engineer*, *WSO2, Inc.; http://wso2.com/ Mobile : +94 777 24 73 39 | +94 718 74 44 08 lean.enterprise.middleware
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
