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/BOL/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.BOL" 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 PDF 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 ProNumber 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 BOLService As Saia.BOL.BOL = New Saia.BOL.BOL
        Dim request As Saia.BOL.Create = New Saia.BOL.Create

	request.UserID = "Your User ID"
	request.Password = "Your Password"
	request.TestMode = "Y"

	request.ShipmentDate = "2013-02-14"
	request.BillingTerms = "Prepaid"

	request.BLNumber = ""
	request.ShipperNumber = ""
	request.StoreNumber = ""
	request.TrailerNumber = ""
	request.PONumber = ""
	request.DepartmentNumber = ""
	request.QuoteNumber = 0

	request.Email = ""
	request.PrintRates = "N"
	request.Customs = "N"
	request.GuaranteedDelivery = ""
	request.EmergencyPhone = 0
	request.SpecialInstructions = ""
	request.VICS = "N"

	Dim shipper as Saia.BOL.CustomerItem = New Saia.BOL.CustomerItem
	shipper.AccountNumber = "0123456"

        ' Optional Shipper Location Data, if you do not
        ' specify these properties then the location data
        ' will be use from the Account Number.
        '
	shipper.ContactName = "TESTING NAME"
	shipper.Address1 = "TESTING STREET"
	shipper.Address2 = ""
	shipper.City = "LOS ANGELES"
	shipper.State = "CA"
	shipper.Zipcode = "90001"
	shipper.Zipcode4 = ""
	request.Shipper = shipper

	Dim consignee as Saia.BOL.CustomerItem = New Saia.BOL.CustomerItem
	consignee.AccountNumber = ""
	consignee.ContactName = "TESTING NAME"
	consignee.Address1 = "TESTING STREET"
	consignee.Address2 = ""
	consignee.City = "DALLAS"
	consignee.State = "TX"
	consignee.Zipcode = "75201"
	consignee.Zipcode4 = ""
	request.Consignee = consignee

	Dim cod as Saia.BOL.CODItem = New Saia.BOL.CODItem
	cod.CompanyCheck = ""
	cod.BillingTerms = ""
	cod.Amount = 0
	request.COD = cod

        Dim details(0) As Saia.BOL.DetailItem
        details(0) = New Saia.BOL.DetailItem
        details(0).Class = "50"
        details(0).Package = "SK"
        details(0).Pieces = 1
        details(0).Weight = 100
	details(0).FoodItem = "N"
	details(0).Hazardous = "N"
	details(0).UNHazmatID = ""
	details(0).UNPackageGroup = ""
	details(0).UNBulk = ""
	details(0).Description = "TEST ITEM"
        request.Details = details

        Dim accessorials(0) As Saia.BOL.AccessorialItem
        accessorials(0) = New Saia.BOL.AccessorialItem
        accessorials(0).Code = "ResidentialDelivery"
        request.Accessorials = accessorials

        Try
            Dim response As Saia.BOL.Response = BOLService.Create(request)

            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.ProNumber.Text = response.ProNumber.ToString
                Me.PDF.Text = response.PDF

            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.