Hi everybody. I'm a French new user of Apache CXF.
I've tried the RESTful HTTP Binding Demo published with CXF package, described at these pages : http://cwiki.apache.org/CXF20DOC/http-binding.html http://cwiki.apache.org/CXF20DOC/jax-rs.html The example is located at this repertory: ./apache-cxf-2.1.4/samples/restful_http_binding/ In order to get data from one of these URL, there is no problem : http://localhost:8080/xml/customers http://localhost:8080/json/customers http://localhost:8080/xml/customers/123 http://localhost:8080/json/customers/123 Each URL sent the expected information. When I try to use POST with JSON, no problem too : ============================================================================ $ wget --post-file add.json http://localhost:8080/json/customers --18:51:50-- http://localhost:8080/json/customers => `customers' Résolution de localhost... 127.0.0.1 Connexion vers localhost|127.0.0.1|:8080... connecté. requête HTTP transmise, en attente de la réponse... 200 OK Longueur: non spécifié [ <=> ] 0 --.--K/s 18:51:50 (0.00 B/s) - « customers » sauvegardé [0] ============================================================================ But when i use XML's POST service as described in README.txt, I receive a 500 Internal Server Error : ============================================================================ $ wget --post-file add.xml http://localhost:8080/xml/customers --18:17:32-- http://localhost:8080/xml/customers => `customers.2' Résolution de localhost... 127.0.0.1 Connexion vers localhost|127.0.0.1|:8080... connecté. requête HTTP transmise, en attente de la réponse... 500 Internal Server Error 18:17:32 ERREUR 500: Internal Server Error. ============================================================================ Or : ============================================================================ $ wget --post-file update.xml http://localhost:8080/xml/customers/123 --18:52:06-- http://localhost:8080/xml/customers/123 => `123' Résolution de localhost... 127.0.0.1 Connexion vers localhost|127.0.0.1|:8080... connecté. requête HTTP transmise, en attente de la réponse... 500 Internal Server Error 18:52:06 ERREUR 500: Internal Server Error. ============================================================================ Here are the stacktraces for each XML submissions : ============================================================================ Started CustomerService! Server ready... 7 avr. 2009 18:20:35 org.apache.cxf.binding.http.interceptor.DispatchInterceptor handleMessage INFO: Invoking POST on /customers 7 avr. 2009 18:20:35 org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Invalid URL/Verb combination. Verb: POST Path: /customers at org.apache.cxf.binding.http.interceptor.DispatchInterceptor.handleMessage(DispatchInterceptor.java:74) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:265) at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) 7 avr. 2009 18:21:45 org.apache.cxf.binding.http.interceptor.DispatchInterceptor handleMessage INFO: Invoking POST on /customers/123 7 avr. 2009 18:21:45 org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Invalid URL/Verb combination. Verb: POST Path: /customers/123 at org.apache.cxf.binding.http.interceptor.DispatchInterceptor.handleMessage(DispatchInterceptor.java:74) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:265) at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) ============================================================================ Does someone else had ever get these errors ? Is there a issue ? Thanks for all. -- Raphaël F. L'avenir de nos Libertés Fondamentales passe par la défense de nos Libertés Numériques ! Promouvoir et défendre le logiciel libre : http://www.april.org/ Les projets numériques liberticides du gouvernement français et de l'Europe : http://www.laquadrature.net/ OpenOffice.org en images : http://www.csdm.qc.ca/sitsat-mtl/openoffice/index.htm "Ce qu'il y a de scandaleux dans le scandale, c'est qu'on s'y habitue." Méditez-y...
