usiing VB.net ver.1.1
Hi, this returns shipping quotes and carriers from a website but I don’t know how to put this information into a datagrid or datalist sure with xml shipping quotes. Any advice?
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
button1.Click
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
sb.Append("<FREIGHTQUOTE REQUEST=""QUOTE"" EMAIL=""xmltest@freightquote.com""
PASSWORD=""xml"" BILLTO=""SHIPPER"">")
sb.Append(" <ORIGIN>")
sb.Append(" <ZIPCODE>60606</ZIPCODE>")
sb.Append(" <LOADINGDOCK>true</LOADINGDOCK>")
sb.Append(" <RESIDENCE>false</RESIDENCE>")
sb.Append(" <CONSTRUCTIONSITE>false</CONSTRUCTIONSITE>")
sb.Append(" <INSIDEPICKUP>false</INSIDEPICKUP>")
sb.Append(" </ORIGIN>")
sb.Append(" <DESTINATION>")
sb.Append(" <ZIPCODE>30303</ZIPCODE>")
sb.Append(" <LOADINGDOCK>true</LOADINGDOCK>")
sb.Append(" <RESIDENCE>false</RESIDENCE>")
sb.Append(" <CONSTRUCTIONSITE>false</CONSTRUCTIONSITE>")
sb.Append(" <INSIDEDELIVERY>false</INSIDEDELIVERY>")
sb.Append(" </DESTINATION>")
sb.Append(" <SHIPMENT>")
sb.Append(" <WEIGHT>250</WEIGHT>")
sb.Append(" <CLASS>70</CLASS>")
sb.Append("
<DIMENSIONS>")
sb.Append("
<LENGTH>100</LENGTH>")
sb.Append("
<WIDTH>100</WIDTH>")
sb.Append("
<HEIGHT>100</HEIGHT>")
sb.Append("
</DIMENSIONS>")
sb.Append(" <PRODUCTDESC>TEST</PRODUCTDESC>")
sb.Append(" <PACKAGETYPE>PALLETS</PACKAGETYPE>")
sb.Append(" <STACKABLE>TRUE</STACKABLE>")
sb.Append(" <PIECES>1</PIECES>")
sb.Append(" </SHIPMENT>")
sb.Append("</FREIGHTQUOTE>")
txtRequest.Text = sb.ToString()
End Sub
Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
button2.Click
Dim ex As New Exception
Dim request As System.Net.HttpWebRequest
request =
DirectCast(System.Net.WebRequest.Create("http://b2b.freightquote.com/dll/FQXMLQuoter.asp"),
System.Net.HttpWebRequest)
Try
request.Method = "POST"
request.ContentType = "text/xml"
Dim wr As System.IO.StreamWriter = New System.IO.StreamWriter(request.GetRequestStream(),
System.Text.Encoding.ASCII)
wr.Write(txtRequest.Text.ToString())
wr.Flush()
wr.Close()
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim r As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(),
System.Text.Encoding.ASCII)
Dim sb As System.Text.StringBuilder = New
System.Text.StringBuilder(Convert.ToString(r.ReadToEnd()))
response.Close()
r.Close()
txtResponse.Text = sb.ToString()
Catch ex
Console.WriteLine(ex.ToString())
End Try
End Sub
It should look something similar to this sites http://shipping.vendingworld.us/ shipping grid when you enter zipcode and weight and click on “get quote”
Thanks in advance
Hi, this returns shipping quotes and carriers from a website but I don’t know how to put this information into a datagrid or datalist sure with xml shipping quotes. Any advice?
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
button1.Click
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
sb.Append("<FREIGHTQUOTE REQUEST=""QUOTE"" EMAIL=""xmltest@freightquote.com""
PASSWORD=""xml"" BILLTO=""SHIPPER"">")
sb.Append(" <ORIGIN>")
sb.Append(" <ZIPCODE>60606</ZIPCODE>")
sb.Append(" <LOADINGDOCK>true</LOADINGDOCK>")
sb.Append(" <RESIDENCE>false</RESIDENCE>")
sb.Append(" <CONSTRUCTIONSITE>false</CONSTRUCTIONSITE>")
sb.Append(" <INSIDEPICKUP>false</INSIDEPICKUP>")
sb.Append(" </ORIGIN>")
sb.Append(" <DESTINATION>")
sb.Append(" <ZIPCODE>30303</ZIPCODE>")
sb.Append(" <LOADINGDOCK>true</LOADINGDOCK>")
sb.Append(" <RESIDENCE>false</RESIDENCE>")
sb.Append(" <CONSTRUCTIONSITE>false</CONSTRUCTIONSITE>")
sb.Append(" <INSIDEDELIVERY>false</INSIDEDELIVERY>")
sb.Append(" </DESTINATION>")
sb.Append(" <SHIPMENT>")
sb.Append(" <WEIGHT>250</WEIGHT>")
sb.Append(" <CLASS>70</CLASS>")
sb.Append("
<DIMENSIONS>")
sb.Append("
<LENGTH>100</LENGTH>")
sb.Append("
<WIDTH>100</WIDTH>")
sb.Append("
<HEIGHT>100</HEIGHT>")
sb.Append("
</DIMENSIONS>")
sb.Append(" <PRODUCTDESC>TEST</PRODUCTDESC>")
sb.Append(" <PACKAGETYPE>PALLETS</PACKAGETYPE>")
sb.Append(" <STACKABLE>TRUE</STACKABLE>")
sb.Append(" <PIECES>1</PIECES>")
sb.Append(" </SHIPMENT>")
sb.Append("</FREIGHTQUOTE>")
txtRequest.Text = sb.ToString()
End Sub
Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
button2.Click
Dim ex As New Exception
Dim request As System.Net.HttpWebRequest
request =
DirectCast(System.Net.WebRequest.Create("http://b2b.freightquote.com/dll/FQXMLQuoter.asp"),
System.Net.HttpWebRequest)
Try
request.Method = "POST"
request.ContentType = "text/xml"
Dim wr As System.IO.StreamWriter = New System.IO.StreamWriter(request.GetRequestStream(),
System.Text.Encoding.ASCII)
wr.Write(txtRequest.Text.ToString())
wr.Flush()
wr.Close()
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim r As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(),
System.Text.Encoding.ASCII)
Dim sb As System.Text.StringBuilder = New
System.Text.StringBuilder(Convert.ToString(r.ReadToEnd()))
response.Close()
r.Close()
txtResponse.Text = sb.ToString()
Catch ex
Console.WriteLine(ex.ToString())
End Try
End Sub
It should look something similar to this sites http://shipping.vendingworld.us/ shipping grid when you enter zipcode and weight and click on “get quote”
Thanks in advance