This C# 2008 console application shows how to create a basic WCF client application that uses our RasterService to convert an image from a CMP to a BMP. For the most part, it's an implementation of the help file example
http://www.leadtools.com...acts.ConvertRequest.htmlThis is a fully functional project and should compile and work with our 16.5 WCF services running in IIS, but I've included the steps taken to create this project from scratch:
1. First make sure that the WCF services are running in IIS by using our IIS setup demo: C:\Program Files\LEAD Technologies\LEADTOOLS 16.5\Shortcuts\.NET WCF Class Library\01 IIS Setup for WCF Demos\01 IIS Setup Tool 32-bit. Follow the steps to set it up and then run the test button on the "WCF Services Properties and Test" tab.
2. Open VS2008 and create a new C# Console application.
3. Add references to System.Runtime.Serialization and System.ServiceModel.
4.* Open the Microsoft Windows SDK CMD shell (Start -> Programs -> Microsoft Windows SDK -> CMD Shell and browse to the directory of the project you just created. Now execute the command svcutil.exe /language:cs /out:ServiceProxy.cs /config:app.config http://localhost/LEADTOOLSWCFServices/RasterService.svc.
- This is the typical way of generating the necessary client files for any WCF service. For more details on this process, see steps 4 and 5 from the following MSDN tutorial:
http://msdn.microsoft.co...us/library/ms734712.aspx - If you were planning on using multiple services, you would need to do this for each service and either merge the files into one or include multiple files. There are other ways to generate these files and for more information, check out the documentation on svcutil.exe:
http://msdn.microsoft.co...us/library/aa347733.aspx5.* Add the files created in step 3 to your project. I had to modify the buffer and array size limits in the config file.
6. Add necessary using statements for the namespaces in the code file generated by svcutil.exe and write your code to interface with the service.
* There are multiple ways of doing steps 4 and 5 and here's a couple of other options:
- Use the files that come with our WCF examples like \Examples\DotNet\CS\ImageProcessingClientDemo\Utilities\App.config & LeadtoolsServices.cs.
- In the Solution Explorer, right click on the project and select Add Service Reference and add a reference to http://localhost/LEADTOOLSWCFServices/RasterService.svc and it will generate the App.config file and service reference which has the same information as the proxy code file.