preload
Mrz 02

Due to the fact I got in touch with maven2 and I think that maven2 is very helpful will give a short introduction. Bigger projects normally have a more complex configuration but I will start from the scratch.

Maven will create a kind of project sceleton with the following command

1
mvn archetype:create -DgroupId=info.sobek.testapp -DartifactId=testapp

If you work with e.g. eclipse, you can create the project files for eclipse:

1
mvn eclipse:eclipse

Now you can import it into eclipse with “import into existing workspace” option of eclipse.

Maven will normally copy the created so called “artifacts” into your local maven repository. Normally located under your home dir and then .m2

When you program depends on several jars and these dependencies are defined in the pom.xml, then maven will copy the jars in their specific version into the local maven repository. This is very helpful because you can simply build your project with another newer or older version of your dependent jar-file.

How to create multi-module projects will be explained in another episode.

Tagged with:
Dez 09

Normally you can create stub classes from a wsdl-file via console by calling wsdl2java. To generate stub classes from wsdl with netbeans you have to add to the build.xml file the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<path id="axis.classpath">
   <fileset dir="/usr/local/axis/lib/">
      <include name="**/*.jar" />
    </fileset>
</path>
 
<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
 
<target name="Generate From WSDL">
    <axis-wsdl2java
    output="src/"
    testcase="false"
    verbose="true"
    serverside="false"
    url="http://url.to-webservice.com/?wsdl">
    <mapping namespace="http://axis.apache.org/ns/interop"
    package="wsdltester" />
    <mapping namespace="http://www.namespace.de/types/"
    package="wsdltester.stubs" />
    <mapping namespace="http://www.namespace.de/services/"
    package="wsdltester.service" />
 
    </axis-wsdl2java>
</target>

Note that you have to modify several settings like the namespaces and the url to the web service on line 15! Do not just copy the code.

Tagged with: