cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Patrick Floyd" <seani...@gmx.net>
Subject Problems with maven generated services and clients
Date Wed, 25 Aug 2010 09:12:39 GMT
Hello,

 

I have a sample maven project which has the following structure:

 

Root

-          Api (service interfaces)

-          Impl (api implementation)

-          Server (web service wrapped around impl)

-          Client (web service client, knows only about api and about
server's generated wsdl)

 

In the server artifact, I use the maven java2ws plugin to generate a simple
frontend:

 

<plugin>

      <groupId>org.apache.cxf</groupId>

      <artifactId>cxf-java2ws-plugin</artifactId>

      <version>2.2.9</version>

      <dependencies>

            <dependency>

                  <groupId>org.apache.cxf</groupId>

                  <artifactId>cxf-rt-frontend-simple</artifactId>

                  <version>${cxf.version}</version>

            </dependency>

      </dependencies>

      <configuration>

 
<className>com.mycompany.service.impl.TestServiceImpl</className>

            <genWsdl>true</genWsdl>

            <frontend>simple</frontend>

            <databinding>aegis</databinding>

            <serviceName>testService</serviceName>

            <quiet>false</quiet>

 
<schemaTargetNamespace>http://www.mycompany.com/data/test</schemaTargetNames
pace>

            <schemaTargetNamespacePrefix>td</schemaTargetNamespacePrefix>

 
<targetNamespace>http://www.mycompany.com/services/test</targetNamespace>

            <targetNamespacePrefix>ts</targetNamespacePrefix>

            <soap12>true</soap12>

            <attachWsdl>false</attachWsdl>

            <argline>-s
${project.build.directory}/generated-sources/cxf</argline>

      </configuration>

      <executions>

            <execution>

                  <phase>generate-sources</phase>

                  <id>generate-wsdl</id>

                  <configuration>

 
<outputFile>${project.build.outputDirectory}/testService.wsdl</outputFile>

                  </configuration>

                  <goals>

                        <goal>java2ws</goal>

                  </goals>

            </execution>

      </executions>

</plugin>

 

I then unpack this WSDL in the client artifact and try to generate client
code from it using the codegen plugin:

 

<plugin>

      <groupId>org.apache.maven.plugins</groupId>

      <artifactId>maven-dependency-plugin</artifactId>

      <version>2.1</version>

      <executions>

            <execution>

                  <id>unpack</id>

                  <phase>generate-sources</phase>

                  <goals>

                        <goal>unpack</goal>

                  </goals>

                  <configuration>

                        <artifactItems>

                             <artifactItem>

                                   <groupId>${project.groupId}</groupId>

                                   <artifactId>server</artifactId>

                                   <version>${project.version}</version>

                                   <type>jar</type>

                                   <overWrite>true</overWrite>

 
<outputDirectory>${project.build.directory}/unpacked</outputDirectory>

                                   <includes>**/*.wsdl</includes>

                             </artifactItem>

                        </artifactItems>

                  </configuration>

            </execution>

      </executions>

</plugin>

 

<plugin>

      <groupId>org.apache.cxf</groupId>

      <artifactId>cxf-codegen-plugin</artifactId>

      <version>${cxf.version}</version>

      <executions>

            <execution>

                  <id>generate-sources</id>

                  <phase>generate-sources</phase>

                  <configuration>

 
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>

                        <wsdlOptions>

                             <wsdlOption>

 
<wsdl>${project.build.directory}/unpacked/testService.wsdl</wsdl>

                             </wsdlOption>

                        </wsdlOptions>

                  </configuration>

                  <goals>

                        <goal>wsdl2java</goal>

                  </goals>

            </execution>

      </executions>

</plugin>

 

However, I get the following exception:

 

file:/C:/. [path snipped] ./testService.wsdl:[91,5]

 Caused by
{http://impl.service.mycompany.com/}[binding:TestServiceImplSoapBinding] not
exist.

 

What am I missing?

 

Can find the sample project at this address:

 

http://mostlymagic.com/cxf-test.zip

 

Thanks in advance for your help,

 

Sean

 

-- 

MostlyMagic.com - Sean Patrick Floyd

IT-Consultant und Senior Java Developer

Mobile: +49 170 4746496

Mail:    <mailto:info@mostlymagic.com> info@mostlymagic.com

Web:     <http://www.mostlymagic.com> www.mostlymagic.com

XING:    <https://www.xing.com/profile/SeanPatrick_Floyd>
https://www.xing.com/profile/SeanPatrick_Floyd

GULP:    <http://www.gulp.de/Profil/mostlymagic.html>
http://www.gulp.de/Profil/mostlymagic.html

 


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