Generate web service stubs from WSDL

In most web services projects, you wrap existing software in a web service and publish a WSDL to define the services available. But, consider going the other direction — you’ve got an existing web service definition, and you want to build sofware to perform to that specification. Here are some ways to get started pdq.

WSDL to .Net

I saw this tip first in a posting in a Joel on Software forum. One of the built-in tools in .Net is WSDL.EXE (look in the SDK folder in your Visual Studio.net install). Normally, this tool is used to generate web reference mapping code so that you can use a web service in your application, but it’s equally happy to create “stub” code for you given an existing WSDL.
Notes:

  • Syntax looks something like this: C:Program FilesMicrosoft Visual Studio .NET 2003SDKv1.1Bingenerated>..ws
    l /server /language:vb {your WSDL URL here}

  • type WSDL.EXE with no params to get help
  • the language param can be used to generate code in C#, VB, or VJ#
    (language = CS, VB, JS, VJS)

WSDL to Java

Although I haven’t played with this (yet), I’d be remiss if I didn’t point out the Apache Axis Project, which does much the same type of thing for Java. See http://ws.apache.org/axis/cpp/winuser-guide.html for a short write-up on getting started.

2 Replies to “Generate web service stubs from WSDL”

Comments are closed.