You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Vespa, Anthony J" <aj...@cbs.com> on 2007/12/20 18:49:43 UTC

CXF and JSON

I'm considering implementing (or re-implementing) a service from
REST/SOAP to JSON.  I'm wondering if someone has a workable example (the
docs I've found are a bit sparse) in terms of how to configure my
beans.xml and how to set up the SEI.

Thanks!

RE: CXF and JSON

Posted by "Liu, Jervis" <jl...@iona.com>.
It should work with the latest snapshot. Make sure you set your request content type to "application/json". I have an example of this located under: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

What do you mean by outside CXF?

Cheers,
Jervis

> -----Original Message-----
> From: Vespa, Anthony J [mailto:ajvespa@cbs.com]
> Sent: 2007年12月21日 22:57
> To: cxf-user@incubator.apache.org
> Subject: RE: CXF and JSON
> 
> Is it possible to actually use JSON as an input to a service vs forming a URL?
> Is that even possible outside of CXF?
> 
> -----Original Message-----
> From: Liu, Jervis [mailto:jliu@iona.com]
> Sent: Thursday, December 20, 2007 10:00 PM
> To: cxf-user@incubator.apache.org
> Subject: RE: CXF and JSON
> 
> I would encourage you to try CXF JSR-311 (JAX-RS) implementation instead.
> It is standard based (CXF HTTP binding is not standard based), and the
> development activities around CXF JSR-311 are much more active.
> 
> CXF JSR-311 (JAX-RS) demo: samples\restful_jaxrs
> System test:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/or
> g/apache/cxf/systest/jaxrs/
> 
> And they all work! :-)
> 
> Docs: http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html
> 
> Let me know if you run into any problems.
> 
> Cheers,
> Jervis
> 
> > -----Original Message-----
> > From: Willem Jiang [mailto:willem.jiang@gmail.com]
> > Sent: 2007年12月21日 7:02
> > To: cxf-user@incubator.apache.org
> > Subject: Re: CXF and JSON
> >
> > Hi ,
> > You can find the example in the CXF_KIT/samples/restful_http_binding
> >
> > Willem.
> > Vespa, Anthony J wrote:
> > > I'm considering implementing (or re-implementing) a service from
> > > REST/SOAP to JSON.  I'm wondering if someone has a workable
> example
> > (the
> > > docs I've found are a bit sparse) in terms of how to configure my
> > > beans.xml and how to set up the SEI.
> > >
> > > Thanks!
> > >
> > >
> 
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: CXF and JSON

Posted by "Vespa, Anthony J" <aj...@cbs.com>.
Is it possible to actually use JSON as an input to a service vs forming a URL?  Is that even possible outside of CXF?

-----Original Message-----
From: Liu, Jervis [mailto:jliu@iona.com] 
Sent: Thursday, December 20, 2007 10:00 PM
To: cxf-user@incubator.apache.org
Subject: RE: CXF and JSON

I would encourage you to try CXF JSR-311 (JAX-RS) implementation instead. It is standard based (CXF HTTP binding is not standard based), and the development activities around CXF JSR-311 are much more active. 

CXF JSR-311 (JAX-RS) demo: samples\restful_jaxrs
System test: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/

And they all work! :-)

Docs: http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html

Let me know if you run into any problems.

Cheers,
Jervis

> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com]
> Sent: 2007年12月21日 7:02
> To: cxf-user@incubator.apache.org
> Subject: Re: CXF and JSON
> 
> Hi ,
> You can find the example in the CXF_KIT/samples/restful_http_binding
> 
> Willem.
> Vespa, Anthony J wrote:
> > I'm considering implementing (or re-implementing) a service from
> > REST/SOAP to JSON.  I'm wondering if someone has a workable example
> (the
> > docs I've found are a bit sparse) in terms of how to configure my
> > beans.xml and how to set up the SEI.
> >
> > Thanks!
> >
> >

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: CXF and JSON

Posted by "Vespa, Anthony J" <aj...@cbs.com>.
I am playing around with the regular JSON samples but I am getting back some weird output - essentially I am getting the values as a big 'block' of text with none of the keys present.

Some of the complexity in my app is that I have some XML Types defined in the objects I am returning that are in the namespace of my SOAP services.

My config looks like this in beans.xml


<jaxws:endpoint
            id="jBoardService"
            implementor="com.cbs.bos.ws.json.BoardServiceImpl"
            address="/jBoardService"
            bindingUri="http://apache.org/cxf/binding/http">
        <jaxws:serviceFactory>
            <ref bean='jaxws-and-aegis-service-factoryJ' />
        </jaxws:serviceFactory>
         <jaxws:properties>
                     <entry key="Content-Type" value="application/json"/> 
         </jaxws:properties>

    </jaxws:endpoint>

-----Original Message-----
From: Liu, Jervis [mailto:jliu@iona.com] 
Sent: Thursday, December 20, 2007 10:00 PM
To: cxf-user@incubator.apache.org
Subject: RE: CXF and JSON

I would encourage you to try CXF JSR-311 (JAX-RS) implementation instead. It is standard based (CXF HTTP binding is not standard based), and the development activities around CXF JSR-311 are much more active. 

CXF JSR-311 (JAX-RS) demo: samples\restful_jaxrs
System test: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/

And they all work! :-)

Docs: http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html

Let me know if you run into any problems.

Cheers,
Jervis

> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com]
> Sent: 2007年12月21日 7:02
> To: cxf-user@incubator.apache.org
> Subject: Re: CXF and JSON
> 
> Hi ,
> You can find the example in the CXF_KIT/samples/restful_http_binding
> 
> Willem.
> Vespa, Anthony J wrote:
> > I'm considering implementing (or re-implementing) a service from
> > REST/SOAP to JSON.  I'm wondering if someone has a workable example
> (the
> > docs I've found are a bit sparse) in terms of how to configure my
> > beans.xml and how to set up the SEI.
> >
> > Thanks!
> >
> >

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: CXF and JSON

Posted by "Liu, Jervis" <jl...@iona.com>.
I would encourage you to try CXF JSR-311 (JAX-RS) implementation instead. It is standard based (CXF HTTP binding is not standard based), and the development activities around CXF JSR-311 are much more active. 

CXF JSR-311 (JAX-RS) demo: samples\restful_jaxrs
System test: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/

And they all work! :-)

Docs: http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html

Let me know if you run into any problems.

Cheers,
Jervis

> -----Original Message-----
> From: Willem Jiang [mailto:willem.jiang@gmail.com]
> Sent: 2007年12月21日 7:02
> To: cxf-user@incubator.apache.org
> Subject: Re: CXF and JSON
> 
> Hi ,
> You can find the example in the CXF_KIT/samples/restful_http_binding
> 
> Willem.
> Vespa, Anthony J wrote:
> > I'm considering implementing (or re-implementing) a service from
> > REST/SOAP to JSON.  I'm wondering if someone has a workable example
> (the
> > docs I've found are a bit sparse) in terms of how to configure my
> > beans.xml and how to set up the SEI.
> >
> > Thanks!
> >
> >

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: CXF and JSON

Posted by Willem Jiang <wi...@gmail.com>.
Hi ,
You can find the example in the CXF_KIT/samples/restful_http_binding

Willem.
Vespa, Anthony J wrote:
> I'm considering implementing (or re-implementing) a service from
> REST/SOAP to JSON.  I'm wondering if someone has a workable example (the
> docs I've found are a bit sparse) in terms of how to configure my
> beans.xml and how to set up the SEI.
>
> Thanks!
>
>