Hi Thilina,

thanks for the answer.

For outgoing messages I would like to use a Handler.
Purpose of this handler is not clear to me. Are you going to use the
handler as a transport sender..
I extend OMElementImpl and rewrite the serialize method.
AFAIKS you are hoping to construct the request using the your
OMElementImpl.. But I'm not sure whether you can get this to work on
the server side.. Or are you thinking of creating the JSONOMElement at
the handler..

I try to explain it in detail.
I would like to write a module with a Handler in "MessageOut" phase.
This Module will contain a OMElementImpl.
I write down some java pseudo code:

public class HelloHandler extends AbstractHandler{

public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {

   OMJSONElement json = new OMJSONElement( );

   json.writeSOAPBodytoJSON( msgContext.getEnvelope().getBody() )

   //Delete old Body
   msgContext.getEnvelope().deleteBody;

   //Put new OMJSONElement instead
   //The Body will be empty. But OMJSONElement will have a
   //serialize function to write the json instead of the xml output
   msgContext.getEnvelope().Body=json;

   //change the content type
msgContext.setProperty(Constants.Configuration.CONTENT_TYPE, "application plain/text");

}
}

The input seems to be a little difficult. I change the AxisRESTServlet. I
take the HttpServletRequest and make a copy to my own
JSONHttpServletRequest.
You might have to do this based on the content type of the message.

Yes, I will do this.

All values will be copied to this new instance. Only
the method getInputStream will be changed. This one will transform json to
xml.
You might need to tweak in the commons transport sender to receive the
responses at the client side... Please have a look on the ongoing
MessageBuilder implementation, which is aimed at providing a single
place to do these kind of things.

I don't need a axis2 support for the client. The json client will be javascript. I have a stupid question. What is the best way to build/get a actual axis2 api. I tried maven javadocs but this did not work.

Thanks
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to