VB.NET Example

Top  Previous  Next

Generating the Proxy Class

 

Included as part of the .Net Framework tools is the Web Services Description Language Tool (Wsdl.exe). Using Wsdl.exe, you can create a VB.NET proxy class which can be used to communicate with the FinalBuilder Server web services.

 

Usage:

 

wsdl.exe /n:[namespace] /o:[output_file] /l:VB [build_machine]/Services/FinalBuilderServer.asmx?wsdl

 

Substituting the following:

 

[namespace]  - The namespace that the generated source file should have.

[output_file] - The location where you want the source file to be generated.

[build_machine] - The URL to machine hosting FinalBuilder Server, including the virtual directory if applicable.

 

For example:

wsdl.exe /n:"VSoft" /o:"C:\Proxy.vb" /l:VB http://MyBuildVM/Services/FinalBuilderServer.asmx?wsdl

 

 

Using the Generated Proxy Class

 

You will need to add the proxy class to your VB.NET project and include a reference to 'System.Web.Services'.

 

Imports System

Imports WebService.Sample.VBNet.VSoft

 

Namespace WebService.Sample

  Public Class Program

      Public Shared Sub Main(ByVal args As String())

          ' Instantiate the FinalBuilder Server Proxy Class.

          Dim server As New FinalBuilderServer

 

          ' Authenticate the user.

          Dim authToken As String = server.Authenticate("paul", "my_password")

 

          ' Get the list of all projects configured on this build server.

          Dim projectNames As String() = server.GetProjectNames(authToken)

 

          For Each projectName As String In projectNames

              ' Get the status of the project

              Dim status As ProjectStatus = server.GetProjectStatus(authToken, projectName)

               Console.WriteLine("Project '{0}' state is currently '{1}'.", projectName, status)

 

              ' Get the trigger log of the project

              Dim log As String() = server.GetProjectTriggerLog(authToken, projectName)

               Console.WriteLine("Project '{0}' Trigger Log:", projectName)

 

              For Each line As String In log

                   Console.WriteLine(line)

              Next

          Next

 

           Console.ReadLine()

      End Sub

  End Class

End Namespace