Hi,
Although it works, but I don't recommand you add this plugin for cxf se endpoint. The problem you encounter actually come from that two classes SayHi and SayHiResponse are missing from your cxf se su. If you want to use code first way(as you do in your project), you need provide all necessary class code there. If you just want to provide impl class and let codegen generate all other classes, you need use wsdl first way, and use cxf-codegen-plugin instead, take a look at what we do in the cxf-wsdl-first example shipped with kit.

Freeman


On 2009-11-27, at 下午6:09, Łukasz Budnik wrote:

Hi there,

If anyone is still interested in it.

It turned out that standalone ServiceMix generates WS artefacts after
deployment where as embedded server does not.

Here's the solution. Add jaxws wsgen maven plugin to cxf-se su:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <executions>
                <execution>
                        <goals>
                                <goal>wsgen</goal>
                        </goals>
                        <configuration>
                                
<sei>org.xh.studies.servicemix.ws.HelloWorldImpl</sei>
                                <genWsdl>true</genWsdl>
                                <keep>true</keep>
                        </configuration>
                </execution>
        </executions>
</plugin>

and then, embedded tests work.

Cheers,
Łukasz

2009/11/24 Freeman Fang <[email protected]>:
Hi,

Could you please append whole exception stacktrace?

Or if you can provide your whole maven project which I can take a quick
look, it would be great.

Freeman
On 2009-11-24, at 下午9:13, Łukasz Budnik wrote:

Hi all,

I have a SA which is composed of 2 su (cxf-se and cxf-bc) when I
deploy it on servicemix it works without any problems. I can access my
Web Service using Apache CXF or plain Java 6 JAX-WS.

But when I use servicemix in embedded mode I get errors during
processing of SOAP request:

Unmarshalling Error: unexpected element
(uri:"http://ws.servicemix.studies.xh.org/";, local:"sayHi"). Expected
elements are (none)...

I'm using ServiceMix 3.2.3. Components seem to be picked up by embedded
SM:

2009-11-24 14:02:50 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be
http://localhost:8080/HelloWorld
2009-11-24 14:02:51 sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log)
via org.mortbay.log.Slf4jLog
2009-11-24 14:02:51 sun.reflect.NativeMethodAccessorImpl invoke0
INFO: jetty-6.1.12rc1

If I add

Thread.sleep(5000);

in my test, I can access WSDL file: http://localhost:8080/HelloWorld?wsdl

Here my servicemix.xml file:

<sm:container id="jbi" rootDir="./target/servicemix/data/smx">
       <sm:activationSpecs>
               <sm:activationSpec>
                       <sm:component>
                               <cxfbc:component>
                                       <cxfbc:endpoints>
                                               <cxfbc:consumer
wsdl="classpath:service.wsdl"

 targetService="tns:HelloWorldImplService"
targetInterface="tns:HelloWorld">
                                               </cxfbc:consumer>
                                       </cxfbc:endpoints>
                               </cxfbc:component>
                       </sm:component>
               </sm:activationSpec>
               <sm:activationSpec>
                       <sm:component>
                               <cxfse:component>
                                       <cxfse:endpoints>
                                               <cxfse:endpoint>
                                                       <cxfse:pojo>
                                                               <bean
class="org.xh.studies.servicemix.ws.HelloWorldImpl" />
                                                       </cxfse:pojo>
                                               </cxfse:endpoint>
                                       </cxfse:endpoints>
                               </cxfse:component>
                       </sm:component>
               </sm:activationSpec>
       </sm:activationSpecs>
</sm:container>

I use Maven and these are my dependencies:

<dependency>
       <groupId>org.apache.servicemix</groupId>
       <artifactId>servicemix-core</artifactId>
       <version>3.2.3</version>
       <scope>test</scope>
</dependency>
<dependency>
<groupId>org.xh.studies.servicemix.my-first-servicemix.ws</ groupId>
       <artifactId>web-service-se-su</artifactId>
       <version>0.0.1-SNAPSHOT</version>
       <scope>test</scope>
</dependency>
<dependency>
<groupId>org.xh.studies.servicemix.my-first-servicemix.ws</ groupId>
       <artifactId>web-service-bc-su</artifactId>
       <version>0.0.1-SNAPSHOT</version>
       <scope>test</scope>
</dependency>
<dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.7</version>
       <scope>test</scope>
</dependency>

I'm also curious why all directories inside target/servicemix/data/ smx
are empty...

your help is much appreciated

thanks,
Łukasz


--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com




--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

Reply via email to