locked
Adding a service reference in visual studio 2016? RRS feed

  • Question

  • User-552429013 posted

    Hi, I am new to C## and wanted to know if I can add a service reference to my program in Visual Studio 2016?

    Wednesday, May 11, 2016 1:57 PM

Answers

  • User-166373564 posted

    Hi JorgeDeSantiago,

    Please follow these steps to add a Web reference to a project:

    1. In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference.

      The Add Service Reference dialog box appears.

    2. In the Add Service Reference dialog box, click the Advanced button.

      The Service Reference Settings dialog box appears.

    3. In the Service Reference Settings dialog box, click Add Web Reference.

      The Add Web Reference dialog box appears.

    4. In the URL box, enter the URL of the Web service to use. If you do not know the URL, use the links in the browse pane to locate the Web service you want.

    5. In the Web services found at this URL box, select the Web service to use.

    6. Verify that your project can use the Web service, and that any external code provided is trustworthy.

    7. In the Web reference name field, enter a name that you will use in your code to access the selected Web service programmatically.
    8. Click Add Reference.

      If your project site does not already have one, Visual Studio creates a WebReferences folder. It then creates files that are required for the proxy class using the name that you provided in step 7.

    Have a good day.

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 12, 2016 2:36 AM

All replies

  • User-166373564 posted

    Hi JorgeDeSantiago,

    Please follow these steps to add a Web reference to a project:

    1. In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference.

      The Add Service Reference dialog box appears.

    2. In the Add Service Reference dialog box, click the Advanced button.

      The Service Reference Settings dialog box appears.

    3. In the Service Reference Settings dialog box, click Add Web Reference.

      The Add Web Reference dialog box appears.

    4. In the URL box, enter the URL of the Web service to use. If you do not know the URL, use the links in the browse pane to locate the Web service you want.

    5. In the Web services found at this URL box, select the Web service to use.

    6. Verify that your project can use the Web service, and that any external code provided is trustworthy.

    7. In the Web reference name field, enter a name that you will use in your code to access the selected Web service programmatically.
    8. Click Add Reference.

      If your project site does not already have one, Visual Studio creates a WebReferences folder. It then creates files that are required for the proxy class using the name that you provided in step 7.

    Have a good day.

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 12, 2016 2:36 AM