The example bundle contains all the files you need to build and run a WCF client that accesses a WSIT web service written in the Java programming language.
The csclient-enabled-fromjava.zip bundle contains the following files:
Client.cs, the C# client class
build.bat, the build batch file
This section covers the following topics:
When creating a Java programming language client, you use the wsimport tool to generate the proxy and helper classes used by the client class to access the web service. When creating a WCF client, the svcutil.exe tool provides the same functionality as the wsimport tool. svcutil.exe generates the C# proxy class and contracts for accessing the service from a C# client program.
The example bundle contains a batch file, build.bat, that calls svcutil.exe to generate the proxy class. The command is:
svcutil /config:Client.exe.config http://localhost:8080/wsit-enabled-fromjava/addnumbers?wsdl
The example bundle’s build.bat file first generates the proxy class and configuration file for the client, then compiles the proxy class, configuration file, and Client.cs client class into the Client.exe executable file.
To run build.bat, do the following.
At a command prompt, navigate to the location where you extracted the example bundle.
If necessary, customize the build.bat file as described in To Customize the build.bat File.
Type the following command:
To customize the build.bat file for your environment, do the following:
Open build.bat in a text editor.
On the first line, type the full path to the svcutil.exe tool. By default, it is installed at C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin.
On the first line, change the WSDL location URL if you did not deploy the addnumbers service to the local machine, or if the service was deployed to a different port than the default 8080 port number.
For example, the following command (all on one line) sets the host name to testmachine.example.com and the port number to 8081:
svcutil /config:Client.exe.config http://testmachine.example.com:8081/wsit-enabled-fromjava/addnumbers?wsdl
On line 2, change the location of the csc.exe C# compiler and the System.ServiceModel and System.Runtime.Serialization support DLLs if you installed the .NET 2.0 and 3.0 frameworks to non-default locations.
After the client has been built, run the client by following these steps.