Axis2C : Sending data with Custom content type

153 views Asked by At

The client (Browser) expects to receive a JSON string in response. I have the JSON string to send at the service side. However the calling function (axis2_invoke) expects axiom_node_t which make it return XML.

Is there a way to send my response in a way I want to and not as axiom objects

1

There are 1 answers

6
loentar On

AxiOM is a data abstraction layer, not XML.

When talking about Axis2/C-unofficial which supports JSON natively, you will get response depending of your request format:

  • if you setup Content-Type of your request to application/json you will get response in JSON format;
  • if you setup Content-Type of your request to application/soap+xml you will get response in SOAP format.

Your response AxiOM is to be be converted to appropriate format by Axis2/C's transport sender.