Hi Ailosha,

The code you're trying is specific to HTTP Servlet's - it may not work if
you're invoking the ESB through nhttp transports on port 8280 (try port
9763).

If you're also working with REST, you might find it easier to work with
API's in WSO2 ESB. Please refer the documentation at
http://docs.wso2.org/display/ESB480/Using+the+REST+API


On Mon, Dec 16, 2013 at 1:39 AM, Aliosha <[email protected]> wrote:

> hi,
> im on WSO2 ESB 4.7/4.8
> i'm trying to create/update a REST resource using POST and PUT verbs in my
> rest uri.
> I have to send a list of some values to (i.e. List1=value1, List2=value2
> ...), os i thought about using POST and PUT http parameter for doing this.
>
> This is the proxy i use:
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy xmlns="http://ws.apache.org/ns/synapse";
>        name="DiogeneDynamicEP"
>        transports="https,http"
>        statistics="disable"
>        trace="disable"
>        startOnLoad="true">
>    <target>
>       <inSequence>
>          <class
> name="it.innovapuglia.sistemapuglia.endpoint.DynamicEndpointConfiguration"/>
>       </inSequence>
>       <outSequence>
>          <send/>
>       </outSequence>
>    </target>
>    <description/>
> </proxy>
>
> It simply get the request end sends it to my custom mediator.
> In my mediator i have to get the parameters inside the http request but
> i'm facing up with few difficulties.
> I tried this code:
> public boolean mediate(MessageContext synapseMsgContext) {
>  org.apache.axis2.context.MessageContext axis2MsgContext;
> axis2MsgContext = ((Axis2MessageContext)
> synapseMsgContext).getAxis2MessageContext();
>  HttpServletRequest obj = (HttpServletRequest)axis2MsgContext.getProperty(
> "transport.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());
> }
>
> as suggested in this blog
> http://vvratha.blogspot.it/2013/08/extracting-http-level-information-in.html
>
> But the obj variable i got is alway NULL.
> It's similar to this issue:http://wso2.com/forum/thread/10508
>
> Am i missing anything?
> Thanks
>



-- 
*Ravi Undupitiya*
Software Engineer; WSO2 Inc.; http://wso2.com


*E-mail: [email protected] <http://wso2.com>**M: **+94 772 930 712*

Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to