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 Freitag <Ja...@gmx.de> on 2009/01/04 18:48:16 UTC

Re: How to Work with JSON in Axis

Hi,

Thank you for the link, but I've seen this site before and it helped  
me really,  but not as much as i hoped ;)
I just don't know how to work with a JSON Request in a Axis2 Web  
Service.

How can I for example use  the information, which is in this example  
JSON Request.

{
   "version": "1.1.0",
   "host": "maps.google.com",
   "access_token": "2:k7j3G6LaL6u_lafw:4iXOeOpTh1glSXe",
   "home_mobile_country_code": 310,
   "home_mobile_network_code": 410,
   "radio_type": "gsm",
   "carrier": "Vodafone",
   "request_address": true,
   "address_language": "en_GB",
   "location": {
     "latitude": 51.0,
     "longitude": -0.1
   },
   "cell_towers": [
     {
       "cell_id": 42,
       "location_area_code": 415,
       "mobile_country_code": 310,
       "mobile_network_code": 410,
       "age": 0,
       "signal_strength": -60,
       "timing_advance": 5555
     },
     {
       "cell_id": 88,
       "location_area_code": 415,
       "mobile_country_code": 310,
       "mobile_network_code": 580,
       "age": 0,
       "signal_strength": -70,
       "timing_advance": 7777
     }
   ],
   "wifi_towers": [
     {
       "mac_address": "01-23-45-67-89-ab",
       "signal_strength": 8,
       "age": 0
     },
     {
       "mac_address": "01-23-45-67-89-ac",
       "signal_strength": 4,
       "age": 0
     }
   ]
}

I want for example get the "mac_address" elements out of this request  
so that the Web Service can work with them and create a JSONM  
Response. Thats my second problem. How can i build my customize JSON  
Response Object?? I would be very thankful for example code, which  
shows a simple JSON Request-Response Wbe Sverice!!

Thank You!!!

JF

Am 31.12.2008 um 15:18 schrieb Sameera Jayasoma:

> Hi Jan,
>
> Have a look at the following tutorial.
>
> http://wso2.org/library/768
>
> Sameera.
>
> On Tue, Dec 30, 2008 at 9:57 PM, Jan Freitag <Ja...@gmx.de>  
> wrote:
> Hi,
>
>  im trying to work with JSON Objects in Axis2 but was'nt successfull  
> and I tried a lot . Can anybody show me example code which shows how  
> to use a JSON Request in a Axis2 Web Service and responses to that  
> request in the JSON Format ?
>
> I try to implement a Web Service that  works with the JSON Request  
> Objects and give  a "correct" response in JSON formatted.
>
> Thank you!
>
> JF
>
>
>
>
> -- 
> Sameera
> http://sameera-jayasoma.blogspot.com/
> http://www.flickr.com/photos/sameera-jayasoma