Setup Requirements
To recreate this sample, make a new C# 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
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace CS
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Element;
protected System.Web.UI.WebControls.Label ResponseCode;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.Label Fault;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.Label Message;
protected System.Web.UI.WebControls.Label CurrentStatus;
protected System.Web.UI.WebControls.Label ConsigneeName;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label6;
protected System.Web.UI.WebControls.Label Description1;
protected System.Web.UI.WebControls.Label Label9;
private void Page_Load(object sender, System.EventArgs e)
{
Saia.Shipment.Shipment shipment = new Saia.Shipment.Shipment();
Saia.Shipment.GetByProNumber request = new Saia.Shipment.GetByProNumber();
request.UserID = "Your User ID";
request.Password = "Your Password";
request.TestMode = "Y";
request.ProNumber = 463510000;
// Below are examples of the other tracing request objects.
/* GetByBLNumber
Saia.Shipment.GetByBLNumber request = new Saia.Shipment.GetByBLNumber();
request.UserID = "Your User ID";
request.Password = "Your Password";
request.TestMode = "Y";
request.BLNumber = "12345";
request.OriginZipcode = "38101";
request.DestinationZipcode = "70364";
*/
/* GetByPONumber
Saia.Shipment.GetByPONumber request = new Saia.Shipment.GetByPONumber();
request.UserID = "Your User ID";
request.Password = "Your Password";
request.TestMode = "Y";
request.PONumber = "12345";
request.OriginZipcode = "38101";
request.DestinationZipcode = "70364";
*/
/* GetByShipperNumber
Saia.Shipment.GetByShipperNumber request = new Saia.Shipment.GetByShipperNumber();
request.UserID = "Your User ID";
request.Password = "Your Password";
request.TestMode = "Y";
request.ShipperNumber = "12345";
request.OriginZipcode = "38101";
request.DestinationZipcode = "70364";
*/
/* GetByPartnerNumber
Saia.Shipment.GetByPartnerNumber request = new Saia.Shipment.GetByPartnerNumber();
request.UserID = "Your User ID";
request.Password = "Your Password";
request.TestMode = "Y";
request.PartnerSCAC = "VITR";
request.PartnerNumber = "123456789";
*/
try
{
Saia.Shipment.Response response = shipment.GetByProNumber(request);
if (response.Code != "")
{
// Add error handling code in case Saia responds
// with an Error Code
this.ResponseCode.Text = response.Code;
this.Element.Text = response.Element;
this.Fault.Text = response.Fault;
this.Message.Text = response.Message;
}
else
{
this.CurrentStatus.Text = response.CurrentStatus;
this.ConsigneeName.Text = response.Consignee.Name;
// Below is a sample of how to retrieve an array
// using SOAP objects.
foreach (Saia.Shipment.DetailItem detailItem in response.Details)
{
Description1.Text = detailItem.Description;
break;
}
}
}
catch
{
// Add error handling code in case your unable to connect
// to the Saia Website.
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
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.