Likes

Developing Windows Azure and Web Services Lab @ 7 Ans 1

To support secured communication between the service and the client you will need to define a certificate.
You need to add to the service support for HTTPS binding that uses a certificate and set the client to work with the secured connection.
The main tasks for this exercise are:
1. Add an HTTPS binding in IIS.
2. Host ASP.NET Web API Web application in IIS.
3. Change the addresses of the service used in the client application and run the client application.




To implement the required functionality, you need to perform the following steps:
1. Browse to the location where the Exercise 05.zip file is saved.
2. Extract the Exercise 05.zip file.
3. Double-click the Exercise 05 folder.
4. Press the Window logo key. The Start screen is displayed.
5. Start hyping Internet Information Services.
6. Click the Internet Information Services (IIS) Manager tile. The Internet Information Services (IIS) Manager window is displayed.
7. Click the No button, if the Internet Information Services (IIS) Manager dialog box is displayed.
8. Double-click the Server Certificates icon under the IIS group in the middle pane.
9. Click the Create Self-Signed Certificate link in the Actions pane. The Create Self-Signed Certificate dialog box is displayed.
10. Type BlueYonderAirlinesRootCA in the Specify a friendly name for the certificate text box.
11. Select the Web Hosting option from the Select a certificate store for the new certificate drop-down list.
12. Click the OK button.
13. Expand the node in the Connections pane that has same name as your machine name.
14. Expand the Sites node.
15. Select the Default Web Site node.
16. Click the Bindings link in the Actions pane. The Site Bindings dialog box is displayed.
17. Click the Add button. The Add Site Binding dialog box is displayed.
18. Select the https option from the Type drop-down list.
19. Type localhost in the Host name text box.
20. Select the BlueYonderAirlinesRootCA option from the SSL certificate drop-down list.
21. Click the OK button. An HTTPS binding is added to the Site Binding list.
22. Click the Close button to close the Site Bindings dialog box. When you add HTTPS binding to the Site Binding, all Web applications that are configured with HTTP binding will support HTTPS.
23. Open Microsoft Visual Studio 2012 as administrator.
24. Select FILE—Open—Project-Solution. The Open Project dialog box is displayed.
25. Browse to the location where the Exercise 05.zip file is extracted.
26. Double-click the Exercise 05 folder.
27. Double-click the BlueYonder.Companion folder.
28. Select the BlueYonder.Companion.sln file.
29. Click the Open button. The BlueYonder.Companion - Microsoft Visual Studio (Administrator) window is displayed.
30. Ensure that the Solution Explorer window is opened.
31. Ensure that the BlueYonder.Companion.Host node is expanded.
32. Double-click the Web.config file. The Web.config file is displayed.
33. Locate and replace the string user id=BlueYonder;Password=Pa$$werd; with user id=sa;Password=passwcrdSl23;.
34. Select BUILD—Batch Build. The Batch Build dialog box is displayed.
35. Click the Select All button.
36. Click the Clean button. The Batch Build dialog box is closed automatically.
37. Select BUILD—Batch Build. The Batch Build dialog box is displayed.
38. Ensure that all the check boxes are selected under the Build column.
39. Click the Build button. The Batch Build dialog box is closed automatically.
Note: If errors or warnings are displayed in the build process, right-click the root solution node and then select Manage NuGet Packages for Solution.
Further, click the Restore button in the popup that appears at the top of the dialog box displayed. Once all the references are restored, close the dialog box and repeat the build process.
40. Ensure that the Solution Explorer window is opened.
41. Right-click the BlueYonder.Companion.Host node, and then select Properties The BlueYonder.Companion.Host window is displayed.
42. Select Web in the left pane.
43. Clear the Use IIS Express check box.
44. Click the Create Virtual Directory button. If the Microsoft Visual Studio dialog box appears, click the Yes button.
45. Click the OK button when the confirmation message box is displayed.
46. Select FILE—Save All to save the changes.
47. Switch to the Internet Information Services (IIS) Manager window.
48. Right-click the Default Web Site node, and then select Refresh.
49. Expand the Default Web Site node.
50. Click the BlueYonder.Companion.Host node.
51. Click the Browse '.80 (http) link in the Actions pane. The Internet Explorer window is displayed.
52. Append locations to the address in the address bar. and then press the Enter key. A prompt at the bottom of the Internet Explorer window is displayed.
53. Click the Open button.
54. Select Notepad from the list of available programs, if you are prompted to select a program to open the file. The locations.json file is displayed.
55. Close the locations.json file.
56. Replace the address available in the address bar of the Internet Explorer window with https://localhost/BlueYonder.Companion.Host-locations. and then press the Enter key.
57. Click the Continue to this website (not recommended), link, if you get a message There is a problem with this website's security certificate. A prompt at the bottom of the Internet Explorer window is displayed.
58. Click the Open button.
59. Select Notepad from the list of available programs if you are prompted to select a program to open the file. The locations.json file is displayed.
60. Explore the contents of the file. It contains data of the Location table.
61. Close the locations.json file.
62. Close the Internet Information Services (IIS) Manager window.
63. Close the Internet Explorer window.
64. Switch to Microsoft Visual Studio 2012, and close it.

No comments: