i have developed a custom mediator and i want to try 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:
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? By installing the WSO2 Application Server inside the WSO2 ESB (i ve done this, but how can i specify that i want a service to be exposed on 9763 port?)?
What's the difference between HTTP and NHTTP? Does the ESB performance get lower?