Setup Requirements

To recreate this sample, you will need to download and install the Microsoft SOAP Toolkit.



Sample Application Code

<%

strRequest = "<Create>" & _
             "<UserID>Your User ID</UserID>" & _
             "<Password>Your Password</Password>" & _
	     "<TestMode>Y</TestMode>" & _
	     "<BillingTerms>Prepaid</BillingTerms>" & _
	     "<AccountNumber>0123456</AccountNumber>"

' Outbound
strRequest = strRequest & "<Application>Outbound</Application>" & _
             "<DestinationCity>LOS ANGELES</DestinationCity>" & _
	     "<DestinationState>CA</DestinationState>" & _
	     "<DestinationZipcode>90001</DestinationZipcode>"

' Inbound 
'strRequest = strRequest & "<Application>Inbound</Application>" & _
'             "<OriginCity>LOS ANGELES</OriginCity>" & _
'	      "<OriginState>CA</OriginState>" & _
'	      "<OriginZipcode>90001</OriginZipcode>"

' ThirdParty
'strRequest = strRequest & "<Application>ThirdParty</Application>" & _
'             "<OriginCity>HOUMA</OriginCity>" & _
'	      "<OriginState>LA</OriginState>" & _
'	      "<OriginZipcode>70364</OriginZipcode>"
'             "<DestinationCity>LOS ANGELES</DestinationCity>" & _
'	      "<DestinationState>CA</DestinationState>" & _
'	      "<DestinationZipcode>90001</DestinationZipcode>"

strRequest = strRequest & "<Details>" & _
             "<DetailItem>" & _
             "<Weight>100</Weight>" & _
	     "<Class>50</Class>" & _
	     "</DetailItem>" & _
	     "</Details>" & _

             "<Accessorials>" & _
             "<AccessorialItem>" & _
	     "<Code>LiftgateService</Code>" & _
	     "</AccessorialItem>" & _
	     "</Accessorials>" & _

	     "</Create>"


Dim Code, Element, Fault, Message, TotalInvoice, OriginManager, Rate1

Set soap = Server.CreateObject("MSSOAP.SoapClient30")
Set xml = Server.CreateObject("MSXML2.DOMDocument")

On Error Resume Next 
soap.ClientProperty("ServerHTTPRequest") = True
soap.mssoapinit "http://www.saiasecure.com/webservice/ratequote/soap.asmx?wsdl", "", "", ""

strResponse = soap.ProcessXML(strRequest)

If Err <> 0 Then

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

Else
xml.LoadXml strResponse

' Note: These examples use SelectSingleNode() which accepts a string containing a XPath
' expression. This is a common way to retrieve a node from a small XML Document. 
Code = xml.SelectSingleNode("/Response/Code").Text

If Code <> "" Then

	' Add error handling code in case Saia responds with an Error Code
	Element = xml.SelectSingleNode("/Response/Element").Text
	Fault = xml.SelectSingleNode("/Response/Fault").Text
	Message = xml.SelectSingleNode("/Response/Message").Text

Else

	TotalInvoice = xml.SelectSingleNode("/Response/TotalInvoice").Text
	OriginManager = xml.SelectSingleNode("/Response/OriginTerminal/Manager").Text

	' Below is a sample of how to retrieve an array
        ' using XPath and XML with SelectNodes().

        Set RateDetails = xml.SelectNodes("/Response/RateDetails/RateDetailItem")

        For Each RateDetailItem In RateDetails

        	Rate1 = RateDetailItem.SelectSingleNode("Rate").Text
		Exit For

        Next


End If
End If

Set xml = Nothing
Set http = Nothing
%>
<HTML>
<BODY>

Total Invoice = <% =TotalInvoice %><br>
Origin Manager = <% =OriginManager %><br>
Rate 1 = <% =Rate1 %><br>

<br>

Code = <% =Code %><br>
Element = <% =Element %><br>
Fault = <% =Fault %><br>
Message = <% =Message %><br>

</BODY>
</HTML>


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.