You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Je...@sybase.com on 2010/06/21 17:34:36 UTC
returning JSON instead of XML
I've written some basic services that return XML and everything is working
well. I now need to return JSON instead. Any pointers to the correct way to
return JSON from an axis2/C service? I've found some Java references, but
no documentation on C and a few comments that imply it might not be
supported.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
For additional commands, e-mail: c-user-help@axis.apache.org
Re: returning JSON instead of XML
Posted by Je...@sybase.com.
I should clarify, I have already built the JSON string, I just need to know
how to return it. I don't need it to be built from axiom nodes.
|------------>
| From: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|<Je...@sybase.com> |
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|c-user@axis.apache.org |
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|06/21/2010 09:35 AM |
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|returning JSON instead of XML |
>--------------------------------------------------------------------------------------------------------------------------------------------|
I've written some basic services that return XML and everything is working
well. I now need to return JSON instead. Any pointers to the correct way to
return JSON from an axis2/C service? I've found some Java references, but
no documentation on C and a few comments that imply it might not be
supported.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
For additional commands, e-mail: c-user-help@axis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
For additional commands, e-mail: c-user-help@axis.apache.org
Re: returning JSON instead of XML
Posted by Je...@sybase.com.
Thank you Satish, I will give that a try. I'm wondering if I'm just
returning and accepting json and POX via REST if axis2 is a bit overkill
for my task. I'm also investigating writing my own apache module instead of
using axis2.
|------------>
| From: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|Satish Bvs <bv...@ymail.com> |
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|Apache AXIS C User List <c-...@axis.apache.org> |
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|06/22/2010 02:16 PM |
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------|
|Re: returning JSON instead of XML |
>--------------------------------------------------------------------------------------------------------------------------------------------|
Jeremy,
This is a workaround.
Target:
File: axiom/src/om/om_element.c
Function: axiom_element_create
Existing Implementation
For the function axiom_element_create,
If the localname(a parameter to axiom_element_create) is NULL an
error is generated,
Modify such that,
If the localname is NULL the element creation would proceed.
Subsequently use that element and axiom_element_set_text to fill it
with JSON.
Hope this helps.
Thanks,
Satish.
From: "Jeremy.Mullin@sybase.com" <Je...@sybase.com>
To: c-user@axis.apache.org
Sent: Mon, June 21, 2010 11:34:36 AM
Subject: returning JSON instead of XML
I've written some basic services that return XML and everything is working
well. I now need to return JSON instead. Any pointers to the correct way to
return JSON from an axis2/C service? I've found some Java references, but
no documentation on C and a few comments that imply it might not be
supported.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
For additional commands, e-mail: c-user-help@axis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
For additional commands, e-mail: c-user-help@axis.apache.org
Re: returning JSON instead of XML
Posted by Satish Bvs <bv...@ymail.com>.
Jeremy,
This is a workaround.
Target:
File: axiom/src/om/om_element.c
Function: axiom_element_create
Existing Implementation
For the function axiom_element_create,
If the localname(a parameter to axiom_element_create) is NULL an error is generated,
Modify such that,
If the localname is NULL the element creation would proceed.
Subsequently use that element and axiom_element_set_text to fill it with JSON.
Hope this helps.
Thanks,
Satish.
________________________________
From: "Jeremy.Mullin@sybase.com" <Je...@sybase.com>
To: c-user@axis.apache.org
Sent: Mon, June 21, 2010 11:34:36 AM
Subject: returning JSON instead of XML
I've written some basic services that return XML and everything is working
well. I now need to return JSON instead. Any pointers to the correct way to
return JSON from an axis2/C service? I've found some Java references, but
no documentation on C and a few comments that imply it might not be
supported.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
For additional commands, e-mail: c-user-help@axis.apache.org