28.12.2013 Views

Building Secure ASP.NET Applications - People Search Directory

Building Secure ASP.NET Applications - People Search Directory

Building Secure ASP.NET Applications - People Search Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How To: Call a Web Service Using SSL 471<br />

15. Click Close, and then OK.<br />

16. Expand Certificates (Local Computer) in the left pane of the MMC snap-in.<br />

17. Expand Trusted Root Certification Authorities.<br />

18. Right-click Certificates, point to All Tasks, and then click Import.<br />

19. Click Next to move past the Welcome dialog box of the Certificate Import<br />

Wizard.<br />

20. Enter the path and filename of the CA’s .cer file.<br />

21. Click Next.<br />

22. Select Place all certificates in the following store, and then click Browse.<br />

23. Select Show physical stores.<br />

24. Expand Trusted Root Certification Authorities within the list, and then select<br />

Local Computer.<br />

25. Click OK, click Next, and then click Finish.<br />

26. Click OK to close the confirmation message box.<br />

27. Refresh the view of the Certificates folder within the MMC snap-in and confirm<br />

that the CA’s certificate is listed.<br />

28. Close the MMC snap-in.<br />

5. Develop a Web Application to Call the Web Service<br />

This procedure creates a simple <strong>ASP</strong>.<strong>NET</strong> Web application. You will use this<br />

<strong>ASP</strong>.<strong>NET</strong> Web application as the client application to call the Web service.<br />

<br />

To create a simple <strong>ASP</strong>.<strong>NET</strong> Web application<br />

1. On the Web service client computer, create a new C# <strong>ASP</strong>.<strong>NET</strong> Web application<br />

called <strong>Secure</strong>MathClient.<br />

2. Add a Web reference (by using HTTPS) to the Web service.<br />

a. Right-click the References node within Solution Explorer, and then click Add<br />

Web Reference.<br />

b. In the Add Web Reference dialog box, enter the URL of your Web service.<br />

Make sure you use an HTTPS URL.<br />

Note: If you have already set a Web reference to a Web service without using HTTPS,<br />

you can manually edit the generated proxy class file and change the line of code that<br />

sets the Url property from an HTTP URL to an HTTPS URL.<br />

c. Click Add Reference.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!