Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, August 20, 2009 4:53:17 AM(UTC)


Groups: Registered, Tech Support, Administrators
Posts: 764

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.html

This 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.aspx

5.* 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.
File Attachment(s):
NET - V16 - Simple WCF Client.zip (13kb) downloaded 89 time(s).

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.054 seconds.