We need to dynamically figure out shipping costs so we have added an additional step to the ecommerce module to figure this out once. We plan to update the shipping cost via the API once we retrieve it from the following service:
http://drc.edeliver.com.au/rateCalc.asp?Height=1000&Length=100&Weight=100&Width=100&Pickup_Postcode=1000&Destination_Postcode=2000&Country=AU&Service_Type=STANDARD&Quantity=1
Using the following code:
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest) System.Net.WebRequest.Create("http://drc.edeliver.com.au/rateCalc.asp?Height=100&Length=100&Weight=100&Width=100&Pickup_Postcode=1000&Destination_Postcode=2000&Country=AU&Service_Type=STANDARD&Quantity=1");
request.Proxy = null;
However we are getting an error:
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 155.144.24.25:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) - Unable to connect to the remote server - at System.Net.HttpWebRequest.GetResponse() at CMSModules_Ecommerce_Controls_ShoppingCart_ShoppingCartContent.getPostage() in c:\inetpub\wwwroot\CmsWebsite\CMSecommerce\shoppingcart\ShoppingCartContent.ascx.cs:line 97 at CMSModules_Ecommerce_Controls_ShoppingCart_ShoppingCartContent.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\CmsWebsite\CMSecommerce\shoppingcart\ShoppingCartContent.ascx.cs:line 119
Have we not set something right in the config as it seems to work outside the CMS? Is there a better way to do this?