Raritan Computer CC-WSAPI-0B-v5.1.0-E Marine Radio User Manual


 
39
The following sections describe how to create a Web Services client for
the CCSG written in C#. This description is based on Microsoft Visual
Studio 2008 and IE6 running on Windows XP. Other methods of Web
Service creation are available in Visual Studio 2008, but this document
solely covers services through Windows Communication Foundation
(WCF) and .Net Framework Version 3.5.
In This Chapter
Using a CC-SG Web Service in a Project ............................................... 39
Sample Application for C# ....................................................................... 40
Using a CC-SG Web Service in a Project
1. Choose Project > Add Service Reference using the CC-SG WSDL
URL for the intended service, such as
AuthenticationAndAuthorization.
2. Right click app.config in Solution Explorer. You might have to open
WCF Service Configuration Editor under Tools first. Choose Edit
WCF Configuration.
a. Under Bindings, select New Binding Configuration.
b. Choose customBinding.
c. Remove httpTransport extension if it is already entered as a
Stack Element.
d. Add httpsTransport, then edit it to set RequireClientCertificate to
True.
e. Select the textMessageEncoding extension and set
MessageVersion to Soap11.
f. Select the service under Client->Endpoints.
g. Change the Binding to customBinding.
h. Change BindingConfiguration to the customBinding that you just
created.
i. Edit the Address to use HTTPS, your CCSG's address, and port
9443 (rather than 8080).
Note: You must edit the URL and set the binding for each service
that you use. The same binding can be used for every CCSG
service.
j. Save the configuration.
3. Edit the C# source back in Visual Studio 2008.
Appendix C
Web Services Development in C#