Accessing the Originator Web Service

The Access Originator Web Service button accesses a web service that is hosted on the same computer that hosts the current application. You need to first add a web service project to the current solution. Follow these steps to do so:

  • Go to File -> Add -> New Web Site.

  • Select the ASP.NET Web Service template and select HTTP as the Location.

  • Name the project "http://localhost/MyWebService" and click OK.

  • Right-click on the newly created web service in Solution Explorer and select Build Web Site.

To use the newly created web service, add a new Web Reference to the current project and enter "http://localhost/MyWebService" as the URL.

Note

The steps to add a local web service reference to the current project are the same as that which I've outlined in the "Updating Unmanaged Components Using RegFree COM" section.

Code the Access Originator Web Service button as follows:

'===================================================
    ' Access Originator Web Service
    '===================================================
    Private Sub btnOriginatorWebService_Click( _
       ByVal sender As System.Object, _
       ByVal e As System.EventArgs) _
       Handles btnOriginatorWebService.Click
        Dim ws As New localhost.Service
        MsgBox(ws.HelloWorld)
    End Sub

Get Use ClickOnce to Deploy Windows Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.