Tag Archives: wsdl

webservices contract-first and contract sharing

The webservices contract-first is, i think, a good concept. But how it actually should be executed is really complicated…

in my opinion it is writing the wsdl by hand and then generate the server and clients form it. So the contract is clear. On the otherhand it is also possible to write the server stubs (in eg. java) first, and then generate the wsdl out of it and define this as contract first. The big benefit of the second method is, that noone needs to be able to write the dm wsdl xmls… but is this really contract first?

The big other issue on webservice is the sharing of the wsdl itself… if you have a handwritten wsdl it is easy to share it… but where? But remember the generated server and its generated new wsdl does not need to be exactly the same…

at work we have a seperate service-contract maven project, which puts the wsdl on a seperate server on install. the idea then is then to get the wsdl with cxf and generate the server and clients. Good idea, nobody uses it 🙁

So a different solution should be found…

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 🙂