SPROXY.EXE: XML Web Service Proxy Generator
SPROXY.EXE is a command line tool that generates native C++ client code for accessing an XML Web service based on a WSDL description.
This tool is used by the Visual C++ project system when a Web reference is added to a native C++ project using the Add Web Reference Dialog Box or when Tool is set to Web Service Proxy Generator and Generated Proxy Language is set to Native C++ in the settings for a file.
(Optional) One or more of the following:
/? or /help
Display usage information.
Suppress copyright message.
Disable all warnings.
Do not inject "#pragma once" into output file.
Do not overwrite output file if it already exists.
Do not inject a C++ namespace into the generated proxy file. By default, SPROXY injects a namespace based on the WSDL service name.
Emit unsigned short instead of wchar_t for s:unsignedShort. This is a breaking change in Microsoft Visual C++ 2005. Previously, unsigned short was always emitted for s:unsignedShort.
Inject a namespace named <name> into the generated proxy file. By default, SPROXY injects a namespace based on the WSDL service name.
The namespace must be a valid C++ identifier. The /namespace:<name> option has the same effect as /nonamespace when <name> is empty.
Process the .wsdl file at the specified path <input_location> rather than a .discomap file (default).
(Optional) The name of the file to which the generated code will be written. If the file exists, it will be overwritten unless /noclobber is specified. If outputfile is not specified, SPROXY will create a file in the current directory based on the WSDL service name.
The location of the file describing the XML Web service for which to generate proxy code. input_location can be a URL or file system path to a .discomap or .wsdl file. Specify the /wsdl option when you use a .wsdl file.
SPROXY.EXE can also process a results.discomap file. Note that the .discomap file contains a link to a local copy of the .wsdl file and uses a local copy of the schema file.
SPROXY.EXE will generate a proxy class template derived from CSoapRootHandler and its template argument. The template argument needs to conform to the SOAP client archetype and defaults to CSoapSocketClientT<>.
Each SOAP method exposed by the service will be represented by a method in the proxy class. To access the XML Web service, create an instance of the proxy class and call the appropriate method.
SPROXY.EXE can be found in the Microsoft Visual Studio 8\VC\bin directory of your Visual C++ installation. If you are using Visual C++ on a 64-bit operating system, SPROXY.EXE can be found in the Microsoft Visual Studio 8\VC\bin\amd64 directory (x64) or Microsoft Visual Studio 8\VC\bin\ia64 directory (IPF) of your Visual C++ installation.
See Supported Types and Supported Types in XML Web Services Created with ATL Server for a list of types supported by SPROXY.
The SPROXY-generated client requires MSXML3. Before running the client, you will need to install MSXML3 on the machine on which the generated client is installed.
Xmlinst.exe installs MSXML3 in replace mode. Download the Xmlinst.exe Replace Mode Tool from MSDN at http://go.microsoft.com/fwlink/?LinkId=55145 For information about using Xmlinst.exe, see the Knowledge Base article "PRB: Application Errors Occur After You Run Xmlinst.exe on Production Servers" (Q278636). You can find Knowledge Base articles on the MSDN Library CD-ROM or at http://support.microsoft.com/.
The SPROXY-generated header file includes atlsoap.h. This file declares [emitidl("restricted")];. If IDL emission is restricted when a [module] attribute is encountered, an error will occur. You can enable IDL emission by using [emitidl("true")]; in your code after including atlsoap.h. (atlextmgmt.h includes the same emitidl declaration as atlsoap.h, so the same issues apply.)
The SPROXY-generated methods do not check pointer parameters for NULL before dereferencing. Check pointers for NULL before passing them to methods in the XML Web service proxy class.
The following command line will generate a file, myservice.h, containing C++ proxy code for accessing the XML Web service described by the WSDL obtained from http://myserver/myservice.dll?Handler=GenMyServiceWSDL:
sproxy /wsdl http://myserver/myservice.dll?Handler=GenMyServiceWSDL /out:myservice.h
The following command line will generate an output file containing C++ proxy code for accessing the XML Web service described by the WSDL obtained from results.discomap (which contains a link to a local copy of the .wsdl file):