JAX-WS Dispatch/Provider API should give you what you want. There is a sample 
named jaxws_dispatch_provider in CXF distribution demonstrates how to write 
dispatch/provider in CXF. The reason why you got that exception is because you 
are using CXF HTTP binding in your configuration, which is the wrong. CXF HTTP 
binding is supposed to be used for REST style services, not for SOAP services.  
A configuration snippet like below should do the trick for you:

        <jaxws:endpoint 
          id="PD" 
          
implementor="org.openspcoop.pdd.services.RicezioneContenutiApplicativiWS"
          address="/PD" />

Cheers,
Jervis

> -----Original Message-----
> From: Cencio [mailto:[EMAIL PROTECTED]
> Sent: 2007?10?11? 23:13
> To: [email protected]
> Subject: Message level service
> 
> 
> 
> Hi all,
> 
> i have an old service in axis that uses saaj to work on 
> messages. Now i want
> to migrate on CFX but i encounter some problems...
> 
> First step is make a service that works at message level with 
> saaj. So i
> need that avery message that point to
> http://localhost:8080/CFX/myService/and/some/more    is catch 
> by myService
> service and some method handle it (something like 
> handleMessage(SOAPMessage
> message) )
> 
> To work at Message level i read something about 
> @ServiceProvider but i don't
> reach the goal... 
> 
> i tryed with:
> 
> package org.openspcoop.pdd.services;
> import java.rmi.RemoteException;
> import java.util.Map;
> import javax.xml.soap.SOAPMessage;
> import javax.xml.ws.*;
> 
> @WebServiceProvider
> @ServiceMode(value=javax.xml.ws.Service.Mode.MESSAGE)
> 
> public class RicezioneContenutiApplicativiWS {
>       public SOAPMessage invoke(SOAPMessage msg, Map<String, 
> Object> ctxt) throws
> RemoteException {     
>               return msg;
>         }
> }
> 
> but it doesn't work, it gives this exception when invoking:
> 
> 17:06:10,341 ERROR [STDERR] 11-ott-2007 17.06.10
> org.apache.cxf.binding.http.interceptor.DispatchInterceptor 
> handleMessage
> INFO: Invoking POST on 
> 17:06:10,344 ERROR [STDERR] 11-ott-2007 17.06.10
> 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: 
>         at
> org.apache.cxf.binding.http.interceptor.DispatchInterceptor.ha
> ndleMessage(DispatchInterceptor.java:74)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIn
terceptorChain.java:207)
>         at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(Cha
inInitiationObserver.java:73)
>         at
> org.apache.cxf.transport.servlet.ServletDestination.doMessage(
ServletDestination.java:79)
>         at
> org.apache.cxf.transport.servlet.ServletController.invokeDesti
> nation(ServletController.java:235)
>         at
> org.apache.cxf.transport.servlet.ServletController.invoke(Serv
letController.java:140)
>         at
> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.
java:278)
>         at
> org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.
java:256)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:252)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
cationFilterChain.java:173)
>         at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyH
eaderFilter.java:96)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
cationFilterChain.java:173)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
rapperValve.java:213)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
ontextValve.java:178)
>         at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
SecurityAssociationValve.java:175)
>         at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccCont
extValve.java:74)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
Valve.java:126)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
Valve.java:105)
>         at
> org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(Cach
edConnectionValve.java:156)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
gineValve.java:107)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdap
ter.java:148)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Process
or.java:869)
>         at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHa
ndler.processConnection(Http11BaseProtocol.java:664)
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolT
cpEndpoint.java:527)
>         at
> org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterS
laveWorkerThread.java:112)
>         at java.lang.Thread.run(Thread.java:595)
> 
> 
> 
> I deployed CFX into jboss with this web.xml:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>     "http://java.sun.com/dtd/web-app_2_3.dtd";>
> <web-app>
>         <context-param>
>                 <param-name>contextConfigLocation</param-name>
>                 
> <param-value>WEB-INF/openspcoop_beans.xml</param-value>
>         </context-param>
> 
>         <listener>
>                 <listener-class>
>                        
> org.springframework.web.context.ContextLoaderListener
>                 </listener-class>
>         </listener>
> 
>         <servlet>
>                 <servlet-name>CXFServlet</servlet-name>
>                 <display-name>CXF Servlet</display-name>
>                 <servlet-class>
>                         org.apache.cxf.transport.servlet.CXFServlet
>                 </servlet-class>
>                 <load-on-startup>1</load-on-startup>
>         </servlet>
> 
>         <servlet-mapping>
>                 <servlet-name>CXFServlet</servlet-name>
>                 <url-pattern>/*</url-pattern>
>         </servlet-mapping>
> </web-app>
> 
> 
> and added this openspcoop_beans.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>         xmlns:jaxws="http://cxf.apache.org/jaxws";
>         xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd
>         http://cxf.apache.org/jaxws
>         http://cxf.apache.org/schemas/jaxws.xsd";>
> 
>   <import resource="classpath:META-INF/cxf/cxf.xml"/>
>   <import 
> resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml"/>
>   <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
> 
>    <jaxws:endpoint id="PD"
>                   
> implementor="org.openspcoop.pdd.services.RicezioneContenutiApp
> licativiWS"
>                    address="/PD"
>                    bindingUri="http://apache.org/cxf/binding/http";>
>                   <jaxws:serviceFactory>
>                     <bean
> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>                       <property name="wrapped" value="true" />
>                     </bean>
>                   </jaxws:serviceFactory>
>    </jaxws:endpoint>
> 
> </beans>
> 
> 
> 
> 
> 
> Thx for any help,
> Lorenzo
> -- 
> View this message in context: 
> http://www.nabble.com/Message-level-service-tf4607880.html#a13157993
> Sent from the cxf-user mailing list archive at Nabble.com.
> 

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

Reply via email to