Hi Freeman,

thank you for your response. I want to do something like this with xfire:

@BeforeTest
public void beforeTest(){

        serverFactory = new 
org.springframework.context.support.ClassPathXmlApplicationContext(
                                "classpath:" + SERVER_CONTEXT);

        clientFactory = new XmlBeanFactory(
                        new ClassPathResource(CLIENT_CONTEXT));

        // Start the WebServer
        httpServer = new XFireHttpServer();
        httpServer.setPort(PORT);
        httpServer.start();
        
        XFire xfire = XFireFactory.newInstance().getXFire();
                
        AnnotationServiceFactory osf = new AnnotationServiceFactory(new 
Jsr181WebAnnotations(), xfire.getTransportManager());

        // Stelle den Service an Hand des Interfaces bereit
        Service service = osf.create(HelloWorldService.class);
        service.setInvoker(new BeanInvoker(serverFactory
                        .getBean("HelloWorldServiceBean")));

        // Register the service
        xfire.getServiceRegistry().register(service);
        // Map the URL Parameter  
        configClientFactory(clientFactory);
        serviceClient = (HelloWorldService) clientFactory
                                .getBean("HelloWorldServiceClient");

        }

        @Test
        public void testGetGreeting() {
                serviceClient.getGreeting("Marc");

        }

My client context looks like this:

<bean id="ServiceClient" 
class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
        <property name="serviceClass" value="hello.HelloWorldService" />
        <property name="wsdlDocumentUrl">
                <value>${url}?wsdl</value>
        </property>
        <property name="url" value="${url}" />          
</bean>

And this is from my application context service side:


        <bean id="webAnnotations" 
class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations" />

        <bean id="handlerMapping" 
class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping">
                <property name="typeMappingRegistry">
                        <ref bean="xfire.typeMappingRegistry" />
                </property>
                <property name="xfire">
                        <ref bean="xfire" />
                </property>
                <property name="webAnnotations">
                        <ref bean="webAnnotations" />
                </property>
        </bean>

        <bean 
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                <property name="urlMap">
                        <map>
                                <entry key="/">
                                        <ref bean="handlerMapping" />
                                </entry>
                        </map>
                </property>
        </bean>

Thanks,
Marc

-------- Original-Nachricht --------
Datum: Fri, 13 Jul 2007 14:47:33 +0800
Von: Freeman Fang <[EMAIL PROTECTED]>
An: [email protected]
Betreff: Re: http://schemas.xmlsoap.org/soap/http

> Hi Marc,
> 
> For setup the CXF servlet in a junit test, you can get more details from
> trunk/systests/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java
> and it's superclass
> trunk/systests/src/test/java/org/apache/cxf/systest/servlet/AbstractServletTest.java
> 
> Best Regards
> 
> Freeman
> 
> Marc Baumgartner wrote:
> > Hm, I have the Jetty Module (cxf-rt-transports-http-jetty) in my
> classpath and it doesn't work.
> >
> > How can I set up the CXF Servlet in a JUnit Test? I want to set up a web
> service in a "before test" method, test my service and shut the web
> service down.
> >
> > Marc
> >
> >
> > -------- Original-Nachricht --------
> > Datum: Thu, 12 Jul 2007 11:00:15 -0600
> > Von: "Dan Diephouse" <[EMAIL PROTECTED]>
> > An: [email protected]
> > Betreff: Re: http://schemas.xmlsoap.org/soap/http
> >
> >   
> >> This typically happens if you're trying to create an HTTP webservice
> and
> >> haven't either:
> >> a) Included the Jetty module on your classpath
> >> OR
> >> b) set up the CXFServlet.
> >>
> >> Have you done either of those? What does your config look like?
> >> Thanks,
> >> - Dan
> >>
> >> On 7/12/07, Marc Baumgartner <[EMAIL PROTECTED]> wrote:
> >>     
> >>> Hi all,
> >>>
> >>> I get an org.springframework.beans.factory.BeanCreationException:
> Error
> >>> creating bean with name 'helloWorldWS': Invocation of init method
> >>>       
> >> failed;
> >>     
> >>> nested exception is java.lang.RuntimeException: Could not find
> >>>       
> >> destination
> >>     
> >>> factory for transport http://schemas.xmlsoap.org/soap/http
> >>>
> >>> Where can I find this schema? How do I have to include it in my spring
> >>> conf?
> >>>
> >>> Regards,
> >>> Marc
> >>> --
> >>> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> >>> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> >>>
> >>>       
> >>
> >> -- 
> >> Dan Diephouse
> >> Envoi Solutions
> >> http://envoisolutions.com | http://netzooid.com/blog
> >>     
> >
> >   

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

Reply via email to