Hi
On Tue, Dec 24, 2013 at 2:57 AM, Aliosha <[email protected]> wrote: > i have developed a custom mediator and i want to try to publish it as a > REST service con my WSO2 ESB 4.7.0. > Once i created the REST API, the ESB publishes it on the 8280 port. > On the client side, the POST REST call needs to specify some http > parameters that i need to recover later in the mediator by this code: > You should refer http://docs.wso2.org/display/ESB480/HTTP+Endpoint where you can easily generate request, no need of having custom mediators > > org.apache.axis2.context.MessageContext axis2MsgContext; > axis2MsgContext = ((Axis2MessageContext) > synapseMsgContext).getAxis2MessageContext(); > HttpServletRequest obj = > (HttpServletRequest)axis2MsgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); > > if (obj != null) { > System.out.println("Method :"+ obj.getMethod()); > System.out.println("Content-type :" +obj.getContentType()); > System.out.println("Content-length :"+obj.getContentLength()); > System.out.println("Remote > addtress"+obj.getSession().getLastAccessedTime()); > } > > The object i get is always null. > That's probably because on 8280 ESB uses the NHttp transport. > In what way can i solve this problem? > Have i to activate the HTTP Servlet Transport? How can i do this? > Can I know why you need to use HTTP Servlet for RESTful application communication ? Do you have any specific requirement to use it? Why default transport shipped with ESB (PTT) not works for you? > What's the difference between HTTP and NHTTP? Does the ESB performance get > lower? > Obviously, NHTTP far more efficient than Servelet Transport,because NHTTP is non blocking invocation and it uses NIO for communication.. by default we recommend to use NHTTP because its faster and has high performance numbers.. > Thanks a lot. > Best Regards. > -- Dushan Abeyruwan | Associate Tech Lead Integration Technologies Team PMC Member Apache Synpase WSO2 Inc. http://wso2.com/ Blog:http://dushansview.blogspot.com/ Mobile:(0094)713942042
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
