Tag Archives: apache cxf

wsdl and maven

just created a contract-first wsdl… and actually its my first 😛 and yeah… there might be some errors… but those will be fixed at the end of the project… next year… 🙂

i created it in the frontend-clicky-thing of eclipse… kinda simple, but a bit random, how the wsdl will look like… lets just say, i hope for the best…

next task was to generate the java artifacts out of the wsdl file… with maven… and google really helped me: link

<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/cxf</sourceRoot>
            <wsdlOptions>
               <wsdlOption>
                  <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
               </wsdlOption>
            </wsdlOptions>
         </configuration>
         <goals>
            <goal>wsdl2java</goal>
         </goals>
      </execution>
   </executions>
</plugin>
is the plugin to generate the artifacts… but i m not so sure, that they really are and if they are really usable… but as i sead before… project end next year… enought of time to figure it out 🙂

apache cxf, tomcat and eclipse

apache cxf is my next stop… its a simple way to create webservices… and the tutorial is really hard… ok perhaps only for a for-a-long-time-no-java-developing developer, as i am… the main problem was, that the tutorial is based on your favorite ide… which in my case is eclipse, but without a little bit of help, my favorite ide is really confusing… but with a little help of other (unlinked) tutorials, a little bit of basic understanding of the (and some) concepts and a little bit luck i made it 🙂 ok not sure, but i see an autogenerated wsdl, which actually locks correct 🙂

so what did i do… setting up:

  1. downloaded apach cxf and added it to PATH (not sure if needed)
  2. in eclipse Windows–>Preferences–>Web Services–> CXF 2.x Preferences set the downloaded cxf folder
  3. intsalled a tomcat… its a lie, because it was installed before, but wth
  4. in eclipse Windows–>Preferences–>Server–>Runtime Environment added the tomact… lie again, was set already…

and now… project:

  1. New–>Dynamic Web Project (Name = CXFTest)
  2. Configured it with Target Runtime = Apache Tomcat and Configuration = CXF
  3. Then created all the files, based on the tutorial
  4. To Run: Right – clicked the web.xml and Run As–> Run on Server
  5. Access the WSDL: http://localhost:8080/CXFTest/HelloWorld?WSDL
  6. tada!

i acutally had really big problems to find the wsdl at first, but now its kinda logic 🙂