Hi

@Path replaces @UriTemplate and @PathParam replaces @UriParam, 
I'm wondering why you have no compilation issues with jsr-311-api 0.6 if
use still can use @UriParam ? May be jsr-311-api 0.5 is also on a class
path ?

Cheers, Sergey

-----Original Message-----
From: Doug [mailto:[EMAIL PROTECTED] 
Sent: 06 April 2008 12:49
To: Brad O'Hearne
Cc: cxf-user@incubator.apache.org
Subject: Re: Base class members not serializing / deserializing

On Sun, 6 Apr 2008, Brad O'Hearne wrote:
> Thanks for the reply.  Couple things -- first, @UriParam is now
> apparently @PathParam. Additionally, I cannot get the paths to work. I
> repeatedly get Tomcat errors that there's "No operation matching
> request path...", and others like it....still a black art....I'd love
> to get this worked out, as I've got jax-rs loaded, I just need to be
> able to hit it now. I've tried about every URL combination
> possible....no dice.

@PathParam may well be the next JSR-311 incarnation, but at least for 
apache-cxf-2.1-incubator-20080306.021818-37.zip the annotation that
works,
for me, is @Path. 

Specifically, using my previous example, 
I have a tomcat webapps project "reflncover" which I access by the URL:
 
http://localhost:8080/reflncover/svc/rc/init/myclientid?arg1=val1&arg2=v
al2

The "svc" component of the URL originates from the WEB-INF/web.xml file:

    <servlet-mapping>
                <servlet-name>CXFServlet</servlet-name>
                <url-pattern>/svc/*</url-pattern>
    </servlet-mapping>

Also, in my beans.xml file (referenced by web.xml) I have:

  <import resource="classpath:META-INF/cxf/cxf.xml" />
  <import
resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
  <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> 
  <jaxrs:server id="reflectionCoverage" address="/">
    <jaxrs:serviceBeans>
      <bean class="au.net.mmsn.rc.services.ReflectionCoverageService" />
    </jaxrs:serviceBeans>
  </jaxrs:server>

It works for me. 

Originally I had a bit of trouble figuring the format of the XML to POST
to my /init/ REST service, so I ended up creating a dummy @GET service 
URL that returned a dummy bean class (as XML) that I created and 
populated within my ReflectionCovergeService class (below). Once I had 
that then submitting the same XML structure back "just worked".

Hope this helps.
Doug


> Prior to your post, I had reverted back to my Jax-WS frontend, and I
> discovered that inheritance IS working on serialization (outbound
> serialization on return types) but is NOT working on deserialization
> (inbound deserialization of XML to Java types on parameters). The
> problem is definitely there.

Not sure what you mean by "inheritance" here. I looked briefly at JAX-WS
but wrapping everything in SOAP headers wasn't flexible enough for my
needs. 

Hope this helps
Doug

>
> On Apr 5, 2008, at 7:54 PM, Doug wrote:
> > On Sun, 6 Apr 2008, Brad O'Hearne wrote:
> >> I've moved to 2.1 SNAPSHOT -- my @UriTemplate annotations still
won't
> >> compile. Is there another dependency needed?
> >
> > I think @UriTemplate was deprecated/replaced by @Path by the JSR-311
> > folks,
> > but their spec documents aren't uptodate (thats my understanding
> > anyway)
> >
> >
> > Something like the following works for me (from the 2.1 SNAPSHOT):
> >
> > import javax.ws.rs.Path;
> > import javax.ws.rs.GET;
> > import javax.ws.rs.POST;
> > import javax.ws.rs.core.HttpContext;
> > import javax.ws.rs.core.HttpHeaders;
> > import javax.ws.rs.core.Response;
> > import javax.ws.rs.core.UriInfo;
> > import javax.ws.rs.core.MultivaluedMap;
> > import javax.ws.rs.ProduceMime;
> > import javax.ws.rs.ConsumeMime;
> > import javax.ws.rs.UriParam;
> > import javax.ws.rs.WebApplicationException;
> >
> > @Path("/rc")
> > public class ReflectionCoverageService {
> >
> >     @POST
> >     @Path("init/{clientId}")
> >     @ProduceMime("text/plain")
> >     public String init(@UriParam("clientId") String id, @HttpContext
> > UriInfo
> > info, SomeJavaBeanClass sjbc) {
> >             MultivaluedMap params  = info.getQueryParameters();

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

Reply via email to