Filter WSDL is an efficient and easy way to compile programs/scripts using the NetScaler WSDL. This article describes the need for Filter WSDL, how it works and a simple example for using Filter WSDL.
Summary
The NetScaler WSDL describes services for the entire gamut of NetScaler services. When you use the NetScaler API in your scripts, link to the WSDL and attempt to compile them, the entire WSDL gets included and the time taken to compile and also the eventual size of the program is unnecessarily increased.
Filter WSDL is a method to select only those service definitions from the NetScaler WSDL that are relevant to the API calls made in the script. This drastically reduces the size of the compiled program and also increases the speed of compilation.
FilterWSDL is a program which works on the Windows, FreeBSD and Linux platforms which can be run from the CLI.
The syntax for the FilterWSDL command is as follows
Usage: filterwsdl <fromwsdl> <pattern>
where:
fromwsdl: The wsdl file from which you want to filter
pattern: API method names or patterns that should be filtered
For example, if you want to filter all the service definitions for the API method 'addlbvserver' from the system WSDL file, "NSConfig.wsdl", you can use the command
> filterwsdl NSConfig.wsdl "addlbvserver"
The output of this command is sent to the screen by default but it can be redirected to a file on the system using the UNIX redirect '>' operator. The output of the previous command can be saved into a file called 'NSConfig-Custom.wsdl' using the command as follows,
> filterwsdl NSConfig.wsdl "addlbvserver" > NSConfig-Custom.wsdl
Consider the files NSConfig.wsdl and NSConfig-Custom.wsdl attached to this article. The original WSDL file is 1.58 MB in size while the filtered WSDL file is 6 KB in size.
The pattern used in the filterwsdl command can be used with the '+' and '-' operators and the wildcard '*' operator to create more generic filters.
For example, if you wish to filter the service definitions for all the available load balancing methods, you can use the command
> filterwsdl NSConfig.wsdl "*lb"*
This command will filter all the Load Balancing methods but will also include 'GSLB' methods because the pattern 'lb' will be matched by all 'GSLB' methods also. To include only LB methods and exclude all GSLB methods, use the command as follows
> filterwsdl NSConfig.wsdl +"*lb" -"glsb"*
More Information