Charging and Control Applications (MOSC)

MOSC Banner

HTTP 500 error while sending SMS containing backslash through RESTFUL webservice on OCSG5.0

edited Apr 18, 2011 2:30AM in Charging and Control Applications (MOSC) 3 commentsAnswered ✓
HI,

I am trying to send a message via JSONObject over RESTFUL webservice 

1.  JSONObject s= new JSONObject();

2.       s.put( "addresses" , sno) ;

3.  s.put( "message" ,message) ;

4.  s.put( "senderName" ,shortcode) ;

5.  OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());

6.  wr.write( s.toJSONString());

7.  wr.flush();

8.  // Get the response

9.       BufferedReader rd = new BufferedReader( new InputStreamReader(connection.getInputStream()));

 

Messae is like:                                   String message= “amount1\\KB  \n  amount2\\KB”

Expected received message:      amount1\KB

amount2\KB

Now problem is http server returns me reponse code 500. And cause exception at line 9.

Note: Problem area is String portion \\KB  if String would not be containing this back slash everything goes fine.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center