Setup Requirements

To recreate this sample, make a new VB ASP.NET application within Visual Studio.NET. Then right click References in the Solution Explorer and select Add Web Reference. Then type http://www.saiasecure.com/webservice/ratequote/soap.asmx for the URL and click the Go icon on the right. You should then see a list of methods in the window below. Next change the Web Reference Name to "Saia.RateQuote" and click Add Reference.



Sample Application Code

Public Class WebForm1
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
     Private Sub InitializeComponent()

    End Sub
    Protected WithEvents Element As System.Web.UI.WebControls.Label
    Protected WithEvents Label3 As System.Web.UI.WebControls.Label
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents Label2 As System.Web.UI.WebControls.Label
    Protected WithEvents ResponseCode As System.Web.UI.WebControls.Label
    Protected WithEvents Label5 As System.Web.UI.WebControls.Label
    Protected WithEvents Fault As System.Web.UI.WebControls.Label
    Protected WithEvents Label7 As System.Web.UI.WebControls.Label
    Protected WithEvents Message As System.Web.UI.WebControls.Label
    Protected WithEvents Label9 As System.Web.UI.WebControls.Label
    Protected WithEvents TotalInvoice As System.Web.UI.WebControls.Label
    Protected WithEvents Rate1 As System.Web.UI.WebControls.Label
    Protected WithEvents OriginManager As System.Web.UI.WebControls.Label

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim rateQuote As Saia.RateQuote.RateQuote = New Saia.RateQuote.RateQuote
        Dim RateRequest As Saia.RateQuote.Create = New Saia.RateQuote.Create

        RateRequest.UserID = "Your User ID"
        RateRequest.Password = "Your Password"
        RateRequest.TestMode = "Y"
        RateRequest.BillingTerms = "Prepaid"
        RateRequest.AccountNumber = "0123456"

        ' Outbound
        RateRequest.Application = "Outbound"
        RateRequest.DestinationCity = "LOS ANGELES"
        RateRequest.DestinationState = "CA"
        RateRequest.DestinationZipcode = "90001"

        ' Inbound
        'RateRequest.Application = "Inbound"
        'RateRequest.OriginCity = "LOS ANGELES"
        'RateRequest.OriginState = "CA"
        'RateRequest.OriginZipcode = "90001"

        ' ThirdParty
        'RateRequest.Application = "ThirdParty"
        'RateRequest.OriginCity = "HOUMA"
        'RateRequest.OriginState = "LA"
        'RateRequest.OriginZipcode = "70364"
        'RateRequest.DestinationCity = "LOS ANGELES"
        'RateRequest.DestinationState = "CA"
        'RateRequest.DestinationZipcode = "90001"

        Dim details(0) As Saia.RateQuote.DetailItem

        details(0) = New Saia.RateQuote.DetailItem
        details(0).Weight = 100
        details(0).Class = "50"

        RateRequest.Details = details

        Dim accessorials(0) As Saia.RateQuote.AccessorialItem

        accessorials(0) = New Saia.RateQuote.AccessorialItem
        accessorials(0).Code = "LiftgateService"
        
        RateRequest.Accessorials = accessorials

        Try

            Dim response As Saia.RateQuote.Response = rateQuote.Create(RateRequest)

            If response.Code <> "" Then

                ' Add error handling code in case Saia responds 
                ' with an Error Code

                Me.ResponseCode.Text = response.Code
                Me.Element.Text = response.Element
                Me.Fault.Text = response.Fault
                Me.Message.Text = response.Message

            Else

                Me.TotalInvoice.Text = response.TotalInvoice.ToString
                Me.OriginManager.Text = response.OriginTerminal.Manager

                ' Below is a sample of how to retrieve an array
                ' using SOAP objects.

                For Each RateDetailItem As Saia.RateQuote.RateDetailItem In response.RateDetails

                    Rate1.Text = RateDetailItem.Rate.ToString
                    Exit For

                Next

            End If

        Catch

            ' Add error handling code in case your unable to connect 
            ' to the Saia Website.

        End Try


    End Sub

End Class


Disclaimer:

Saia Inc. authorizes the use of these Web Services solely to facilitate the exchange of information between Saia and the customer. Unauthorized use of Saia, Inc. Web Services and information is strictly prohibited. All services may be used for lawful purposes only. No warranty, express or implied, is given relating to the accuracy of content and Saia, Inc. does not accept any liability for error or omission.

Saia Inc. reserves the right to refuse or cancel these services at it’s sole discretion. If any terms or conditions are failed to be followed, results constitute grounds for immediate account deactivation.