Monday, September 5, 2011

Wsutil.exe

Location: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\Wsutil.exe
put this path in system variable PATH to be visible in CMD shell
Wsutil.exe is Windows Web Services Tool for generating C code from metadata that describes a web service. You are most likely to use this tool as the first step when you need to implement a client to an existing web services or create a new web service. This tool serves the same purpose as WCF Service Model Metadata Utility Tool (Svcutil.exe). There are many commands available in this tool, which you can read about by passing “/?” or “/help” option on the command line. However the core steps for using this tool are:
a. Save your metadata files somewhere on the local hard drive.
i. If you need to download metadata from a running web service, you can use svcutil.exe as follows:
> svcutil.exe /t:metadata <URL to Web Service>
b. Run wsutil.exe on the SDK Shell prompt either as
> wsutil.exe *.wsdl *.xsd
    or
> wsutil.exe /wsdl:<filename> /xsd:<filename> /wsp:<filename>           
When you run wsutil.exe, it is going to process each WSDL, XML schema and policy file and generates one C header and one C source file for each input file.
Please note that you need to provide all WSDL and XSD files at once. Passing an incomplete set will result in wsutil.exe issuing errors for references in the input files to non-present WSDL or XSD files. Make sure that you pass all WSDL and XSD files in one call to the wsutil.exe.

No comments:

Post a Comment