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/shipment/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.Shipment" 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 CurrentStatus As System.Web.UI.WebControls.Label
    Protected WithEvents ConsigneeName As System.Web.UI.WebControls.Label
    Protected WithEvents Description1 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 shipment As Saia.Shipment.Shipment = New Saia.Shipment.Shipment

        Dim ShipmentRequest As Saia.Shipment.GetByProNumber = New Saia.Shipment.GetByProNumber
        Shipmentrequest.UserID = "Your User ID"
        Shipmentrequest.Password = "Your Password"
        Shipmentrequest.TestMode = "Y"
        Shipmentrequest.ProNumber = 463510000

        ' Below are examples of the other tracing request objects.

        ' GetByBLNumber
        'Dim ShipmentRequest As Saia.Shipment.GetByBLNumber = New Saia.Shipment.GetByBLNumber
        'Shipmentrequest.UserID = "Your User ID"
        'ShipmentRequest.Password = "Your Password"
        'ShipmentRequest.TestMode = "Y"
        'ShipmentRequest.BLNumber = "12345"
        'ShipmentRequest.OriginZipcode = "38101"
        'ShipmentRequest.DestinationZipcode = "70364"

        ' GetByPONumber
        'Dim ShipmentRequest As Saia.Shipment.GetByPONumber = New Saia.Shipment.GetByPONumber
        'ShipmentRequest.UserID = "Your User ID"
        'ShipmentRequest.Password = "Your Password"
        'ShipmentRequest.TestMode = "Y"
        'ShipmentRequest.PONumber = "12345"
        'ShipmentRequest.OriginZipcode = "38101"
        'ShipmentRequest.DestinationZipcode = "70364"
			
        ' GetByShipperNumber
        'Dim ShipmentRequest As Saia.Shipment.GetByShipperNumber = New Saia.Shipment.GetByShipperNumber
        'ShipmentRequest.UserID = "Your User ID"
        'ShipmentRequest.Password = "Your Password"
        'ShipmentRequest.TestMode = "Y"
        'ShipmentRequest.ShipperNumber = "12345"
        'ShipmentRequest.OriginZipcode = "38101"
        'ShipmentRequest.DestinationZipcode = "70364"

        ' GetByPartnerNumber
        'Dim ShipmentRequest As Saia.Shipment.GetByPartnerNumber = New Saia.Shipment.GetByPartnerNumber
        'ShipmentRequest.UserID = "Your User ID"
        'ShipmentRequest.Password = "Your Password"
        'ShipmentRequest.TestMode = "Y"
        'ShipmentRequest.PartnerSCAC = "VITR"
        'ShipmentRequest.PartnerNumber = "123456789"

        Try

            Dim response As Saia.Shipment.Response = shipment.GetByProNumber(ShipmentRequest)

            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.CurrentStatus.Text = response.CurrentStatus
                Me.ConsigneeName.Text = response.Consignee.Name

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

                For Each DetailItem As Saia.Shipment.DetailItem In response.Details

                    Description1.Text = DetailItem.Description
                    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.