preload
Dez 10

To create the stub classes in c# you have to add a web reference.

  • Create a new Application, e.g. Console Projekt or Window Application Projekt
  • Right click on References
  • Left click on Add Service Reference
  • Left click at the bottom on the Add Service Reference-Window on Advanced Add Service Reference
  • Left click at the bottom on the Sevice Reference Settings-Window on Add Web Reference
  • Enter the Web Service URL in the URL-Textfield and press go
  • Optional choose another Web Service Namespace
  • Click Add Reference

Et Voilà. Extremly simple.

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: