cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tog <guillaume.all...@gmail.com>
Subject Re: Restful service question
Date Mon, 14 May 2007 07:39:01 GMT
James,

My example is derived from the restful_http_binding sample so I tried to
used
wget --post-file .... to use the post approach and queried
http://localhost:8080/xml/?wsdl to get the wsdl,
http://localhost:8080/xml/books/123 to get book with id 123 but the only
thing the code get is 0 as id ...

Cheers
Guillaume

On 5/14/07, James Mao <james.mao@iona.com> wrote:
>
> Are you using just the GET approach.
> If yes, then the url should follow the scheme
> http://localhost:9090/yourpath/operationName/parameterName/paramerterValue
> Take the /sample/soap12/ as an example.
>
> If you start your server, and you can use your browser to point the url:
> http://localhost:9000/SoapContext/SoapPort/greetMe/requestType/CXF
> And you will get the returned xml as the response.
>
> the "requestType" after the greetMe in the URL is the name just as the
> same name as the name attribute of the WebParam annotation in the
> interface.
>
> Cheers,
> James
> > I  tried to rework  the restful service sample in cxf-2.0-incubator-RC.
> > Unfortunately I got a problem. It looks that my "addBook" and
> > "getBook(GetBook)" methods never have their arguments set. Only the
> > method
> > with no argument "getBooks()" is working !
> >
> > I probably forgot something when writing my service but can't figure
> > what it
> > is.
> >
> > Thanks for your comments.
> >
> > Cheers
> > Guillaume
> >
> > When I query http://localhost:8080/xml/books/123 I just get a NotFound
> > fault. The id I got in the code is 0 with the following exception:
> >
> > 13 mai 2007 07:16:39 org.apache.cxf.phase.PhaseInterceptorChain
> > doIntercept
> > INFO: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault
> >        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
> > AbstractInvoker.java:83)
> >        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
> > AbstractInvoker.java:55)
> >        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(
> > ServiceInvokerInterceptor.java:57)
> >        at org.apache.cxf.workqueue.SynchronousExecutor.execute(
> > SynchronousExecutor.java:37)
> >        at
> > org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(
> > ServiceInvokerInterceptor.java:88)
> >        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > PhaseInterceptorChain.java:148)
> >        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
> > ChainInitiationObserver.java:63)
> >        at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
> > JettyHTTPDestination.java:200)
> >        at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
> > JettyHTTPDestination.java:161)
> >        at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
> > JettyHTTPHandler.java:54)
> >        at org.mortbay.jetty.handler.ContextHandler.handle(
> > ContextHandler.java:690)
> >        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
> > ContextHandlerCollection.java:191)
> >        at org.mortbay.jetty.handler.HandlerWrapper.handle(
> > HandlerWrapper.java:139)
> >        at org.mortbay.jetty.Server.handle(Server.java:285)
> >        at org.mortbay.jetty.HttpConnection.handleRequest(
> > HttpConnection.java:457)
> >        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
> (
> > HttpConnection.java:751)
> >        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
> >        at
> > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
> >        at
> > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
> >        at org.mortbay.io.nio.SelectChannelEndPoint.run(
> > SelectChannelEndPoint.java:329)
> >        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
> > BoundedThreadPool.java:475)
> > Caused by: com.acme.book.BookNotFoundFault
> >        at com.acme.book.BookServiceImpl.getBook(BookServiceImpl.java:61)
> >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >        at sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> >        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:585)
> >        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
> > AbstractInvoker.java:68)
> >        ... 20 more
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message