Generate a Remoting WSDL with soapsuds on Mono 6.8

Mono packages soapsuds to generate WSDL from a Remoting assembly, and the shipped launcher can fail before it reads anything. This guide exports a WSDL document from a .NET Remoting assembly with soapsuds, verifies the result, and works around that packaged launcher failure. It describes the installed mono-devel package, version 6.8.0.105+dfsg-3.6ubuntu2. Allow about fifteen minutes if you already have an assembly to inspect.

No elevated privileges are needed. The examples only read an assembly and create files in a directory you own. They do not contact a service, change a system-wide Mono setting, or publish a WSDL.

1. Check the installed command

Start by checking which executable your shell will run and recording the package version:

$ command -v soapsuds
/usr/bin/soapsuds
$ dpkg-query -W -f='${Package} ${Version}\n' mono-devel
mono-devel 6.8.0.105+dfsg-3.6ubuntu2

The manual describes soapsuds as a generator for WSDL documents and client proxies for remoting services. Its useful inputs are an assembly, a schema file, a WSDL URL, or explicit type and assembly pairs. The output can be a WSDL file, generated source, or a compiled proxy assembly.

Checkpoint: confirm that the command is the one supplied by mono-devel. Do not assume that another soapsuds earlier in PATH accepts the same options.

2. Apply the local launcher workaround

On this installation, running soapsuds directly fails with a Mono SerializationException saying that it cannot find the assembly soapsuds. The shell wrapper points Mono at /usr/lib/mono/4.5/soapsuds.exe, but the assembly directory is not otherwise on the probing path.

Set MONO_PATH only for the command that needs it:

$ MONO_PATH=/usr/lib/mono/4.5 soapsuds -nologo

This exits successfully on the installed system. The -nologo option suppresses the startup logo. Keeping the variable in front of the command avoids changing your shell session or making an untested path global.

If this check still fails, stop here and keep the complete error. Do not work around it by copying executables into system directories. Check the package version and the actual path of soapsuds.exe first:

$ ls -l /usr/lib/mono/4.5/soapsuds.exe
$ MONO_PATH=/usr/lib/mono/4.5 soapsuds -nologo

3. Export an assembly to WSDL

The input assembly path must be absolute with this packaged tool. The output directory must already exist. Replace the two placeholder paths with files you control:

$ mkdir -p "$HOME/soapsuds-output"
$ ASSEMBLY="$HOME/build/RemoteService.dll"
$ WSDL="$HOME/soapsuds-output/remote-service.wsdl"
$ MONO_PATH=/usr/lib/mono/4.5 soapsuds \
    -nologo \
    -inputassemblyfile:"$ASSEMBLY" \
    -outputschemafile:"$WSDL"
Written file /home/you/soapsuds-output/remote-service.wsdl

-inputassemblyfile, also written as -ia, tells the tool to inspect an assembly. -outputschemafile, also written as -os, writes the WSDL. The manual says that this assembly mode includes schemas for serialisable classes it finds. The command does not alter the assembly.

Checkpoint: verify that the output is a non-empty XML file and that the expected service type appears in it:

$ test -s "$WSDL"
$ file "$WSDL"
/home/you/soapsuds-output/remote-service.wsdl: XML 1.0 document, ASCII text
$ rg -n 'definitions|RemoteService' "$WSDL"
1:<definitions name="RemoteService" ...

The exact XML formatting, namespace values and line numbers can vary. A missing type name usually means that the assembly did not expose the remoting types you expected, or that you pointed at the wrong build output.

4. Add a service endpoint when the WSDL needs one

A WSDL can describe types without identifying where a client should connect. Supply -serviceendpoint, or its short form -se, when the generated document needs a service URL:

$ ENDPOINT='http://127.0.0.1:8080/RemoteService.rem'
$ MONO_PATH=/usr/lib/mono/4.5 soapsuds \
    -nologo \
    -inputassemblyfile:"$ASSEMBLY" \
    -serviceendpoint:"$ENDPOINT" \
    -outputschemafile:"$HOME/soapsuds-output/remote-service-endpoint.wsdl"
Written file /home/you/soapsuds-output/remote-service-endpoint.wsdl

This command records an endpoint in generated metadata. It does not start a listener at 127.0.0.1:8080. Use the real URL only when you know the service address and trust the generated document's consumers.

5. Generate proxy source only after checking the WSDL

The input-side switch for a schema is -inputschemafile, or -is. Add -generatecode, or -gc, to request client proxy source, and use -outputdirectory, or -od, for the destination:

$ mkdir -p "$HOME/soapsuds-output/proxy"
$ MONO_PATH=/usr/lib/mono/4.5 soapsuds \
    -nologo \
    -inputschemafile:"$WSDL" \
    -generatecode \
    -outputdirectory:"$HOME/soapsuds-output/proxy"
$ find "$HOME/soapsuds-output/proxy" -maxdepth 1 -type f -print

Do not treat generated classes as the original service implementation. The manual warns that schema-derived fake classes contain data structure, not the semantics of the original types. Review generated source before compiling or distributing it.

On this Mono 6.8 package, proxy generation can fail for a WSDL exported from a simple assembly with an error such as Could not find a part of the path .../http:/schemas.microsoft.com/.... That is a tool or input-shape failure, not proof that the WSDL is valid or that the remote service is reachable. Preserve the WSDL and the full diagnostic, then try a representative assembly with explicit remoting metadata and an endpoint. Do not delete the only copy while investigating.

6. Understand the other output choices

Use -outputassemblyfile, or -oa, when you deliberately want soapsuds to compile a proxy assembly. Use -proxynamespace, or -pn, to choose the generated namespace. -wrappedproxy and -nowrappedproxy select the wrapper style, and -strongnamefile supplies a strong-name file.

These options affect generated artefacts that may enter a build or deployment. Treat a generated assembly as executable code: inspect it, compile it in a disposable build directory, and review the dependency and signing decisions. No example here overwrites an existing source tree.

Done means