You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jan Philipp Seng <Se...@traveltainment.de> on 2007/12/18 17:35:21 UTC

choose XML encoding of SOAP response

Hello Axis2 experts,

 

I am using the Axis2 framework inside Tomcat for offering webservices. I am
a newcomer to Axis2 and I see it is not easy to find a way through.

There is the demand to choose the XML encoding of the response by the
requesting client, especially for switching between "utf-8" and
"ISO-8859-x". Initially my plan was to add a own phase to the InFlow to read
a parameter from the SOAP Header which can be set by the client to select
the encoding like "ISO-8859-x" and modify an option inside the framework
which is responsible for the encoding (I am usind ADB for data binding):

My first try was to change two parameters I found in the MessageContext:

   msgContext.setProperty( "CHARACTER_SET_ENCODING", "ISO-8859-x" );

   msgContext.setProperty( "ContentType", "text/xml; charset=ISO-8859-x" );

This has no effect on the response. It is still in "utf-8". So this was not
a good idea :-(

My second try: I found the property "PROP_XML_ENCODING" in the class
AxisEngine, but I cant find a way to access the instance that is responsible
the process the SOAP message via MessageContext.

Can you help me with this problem? Do I have to add a phase to the OutFlow?
Or do I have to set an option of ADB at runtime? Do sample code exist on
this topic?

 

Thank you very much,

Jan Philipp Seng