Hi all,

I am stuck with a strange problem. similar to 

http://markmail.org/message/65dec77yvimv2xat#query:ServiceMix%20CDATA+page:1+mid:32vexgibvf4yjabu+state:results

I have a requirement where a Mobile App wants to send a Json request  as that 
is 
apparently faster to process than XML. What i did was exposed a simplistic 
webservice

<Request>

<![CDATA[
{
  "Username": "xyz",
  "Password": "xyz",

  "MyReq":   {
    "abc": "1332222053",
    "CCC": {"PPP": {"aaa": {"bbb": "rrrr"}}}
  }
}
 
 
]]>
</Request>

i.e wrapped the Json in CDATA in a xml request. The request is posted to a 
Servicemix 3.3.2 Http component which then forwards it to Smix 3.3.2 LWC 
component. In the Lwc receiver I then extract the JSON and work on it using 
Jsson utilities. In the response I am sending like
<Response>

<![CDATA[
{
 
 "Status":   { 
    "code": "001",
    "Msg": "SUCCESS"
  }
}
 
 
]]>
</Response>

However after the exchange is sent - in teh client the CDATA section is striped 
off and what I receive is just <Response/>
I have logged the exchange.getContent and still it contains the CDATA section 
till then. So not to sure at what point it is getting lost. With Smix 3.2.1 it 
did strip off the "<![CDATA[" syntax but still had the content of the CDATA in 
the response like
<Response>


{
 
 "Status":   { 
    "code": "001",
    "Msg": "SUCCESS"
  }
}
 
</Response>

Any clue as to why it behaves that way in Smix 3.3.2?


Also next question -
can't we paste a generic String or say a Json request object in Servicemix HTTP 
POST request at all? Is it like it only allows xml? I initially ahd tried to 
use 
plain Json string in the body of the POST but that failed during marshalling 
and 
rejected as invalid request.

Please if an expert can help I would eb greatful

Cheers,
Soumya

Reply via email to