Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Getting data from external web service for shopping cart shipping in ecommerce View modes: 
User avatar
Member
Member
Darren - 1/23/2011 7:29:33 PM
   
Getting data from external web service for shopping cart shipping in ecommerce
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?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/15/2011 4:52:46 PM
   
RE:Getting data from external web service for shopping cart shipping in ecommerce
Hi,

Maybe you have already found some solution, but anyway:
This is quite general issue and could be caused by more things.

As suggested at stackoverflow.com discussion, it could be a firewall issue or problem with proxies or other server config.

You may need to configure default proxy like described at:
http://support.microsoft.com/kb/318140

Hope that some info from these sources helps.

Regards,
Zdenek