Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreLive QuotesLive Quotes
Previous
 
Next
New Post
1/5/2010 5:16 PM
 

I wish to implement this script:

http://sellonline.canadapost.ca/DevelopersResources/HTMLReturn/HTTP_Post_Sample_With_ASP.asp

It is the live quote example script from Canada Post.

I'm trying to find the point that would be best to start this implementation at but I know so little about ASP.NET specifically (let alone ASP) that I could really use a hand.

Has anybody done anything similiar?  Is this easier / harder than it seems (it seems like it should be quite easy)?

Cheers!

Edit:  Just to expand on what I have done up to now:

Installed the VB Pro from MS.  Installed the previous version of DNN for development as per Gilles' posts.  Ensured my hierarchy is in order and have been Googling since.
I'm currently thinking I have to create an entirely new provider as was mentioned in a thread below, but if possible I wish to place this as the default shipping method and simply have the weight calculation take place if the live quote times out or otherwise fails.

I'll post as I progress.

 
New Post
1/5/2010 7:51 PM
 

Hi,

The Store module is provider based and you can create your own Gateway provider, Shipping provider and Tax provider. This allow you to adapt the module using your rules or requirements. This require a strong knowledge about ASP.NET, C# and DNN module development. Moreover, it's NOT a requirement to use DNN 4.4.1 if you do not want to sell your provider. As explained in my post, I use this old version for wider compatibility only.

Basicaly, the default shipping provider receive both shipping and billing addresses and the content cart. With this information, your are able to retreive each product info class containing product measures (height, width, ...) and to build the XML request to transmit to the Canada Post server. Please look at the DotNetNuke.Store.Providers.Shipping.DefaultShippingProvider project for detail about the interface.

Gilles


We (team members) are Humans offering their knowledge, their work and their spare time FOR FREE to benefit the community. It would be so particularly appreciated that your messages begin with "Hello" and end with "Thank you" or any other form of politeness. Ask yourself what your reaction would be, if you were approached by me (a total stranger) on the street to ask you something without saying "Hello" nor "Thank you"? After several years of services dedicated to the community, I begin to be tired to read requests without any form of politeness.
 
New Post
2/22/2010 4:12 AM
 

So I've got this code chunk :

using System.IO; //Used for Stream Writer

using
System.Net; //Used for webResponse

 
//Page level vars
protected string strCPXMLRequest = "";

private const string strCPRetailerID = " PUT YOUR CANADA POST ID HERE";

private const string strCP_PostURL = "http://sellonline.canadapost.ca:30000";

protected void Page_Load(object sender, EventArgs e)

{

//Build CP XML

// This will eventually become dynamic from the products ordered

strCPXMLRequest = " <?xml version='1.0' ?> ";

strCPXMLRequest += "<eparcel> ";

strCPXMLRequest += "<language> en </language> ";

strCPXMLRequest += "<ratesAndServicesRequest> ";

strCPXMLRequest += " <merchantCPCID> " + strCPRetailerID + " </merchantCPCID> ";

strCPXMLRequest += " <lineItems> ";

strCPXMLRequest += " <item> ";

strCPXMLRequest += " <quantity> 1 </quantity> ";

strCPXMLRequest += " <weight> 1.5 </weight> ";

strCPXMLRequest += " <length> 1 </length> ";

strCPXMLRequest += " <width> 1 </width> ";

strCPXMLRequest += " <height> 1 </height> ";

strCPXMLRequest += " <description> My Sample Item</description> ";

strCPXMLRequest += " </item> ";

strCPXMLRequest += " </lineItems> ";

strCPXMLRequest += " <city> </city> ";

strCPXMLRequest += " <provOrState> Wisconsin </provOrState> ";

strCPXMLRequest += " <country> CANADA </country> ";

strCPXMLRequest += " <postalCode> H3K1E5 </postalCode> ";

strCPXMLRequest += "</ratesAndServicesRequest> ";

strCPXMLRequest += "</eparcel>";

HttpWebResponse webResponse;

try

{

HttpWebRequest webRequest = WebRequest.Create(strCP_PostURL) as HttpWebRequest;

// 10 secs

webRequest.Timeout = 10000;

//Method

webRequest.Method = "POST";

// Content type

webRequest.ContentType = "text/xml";

// Wrap the request stream with a text-based writer

StreamWriter swXMLPost = new StreamWriter(webRequest.GetRequestStream());

// Write the XML text into the stream

swXMLPost.WriteLine(strCPXMLRequest);

swXMLPost.Close();

swXMLPost = null;

// Send the data to the webserver

webResponse = webRequest.GetResponse() as HttpWebResponse;

if (!webRequest.HaveResponse || (webResponse.StatusCode != HttpStatusCode.OK && webResponse.StatusCode != HttpStatusCode.Accepted))

{

//Must do somehting here there is an error with the canada post responce etc.

}

StreamReader srCPResponse = new StreamReader(webResponse.GetResponseStream());

string strCPResponse = srCPResponse.ReadToEnd();

srCPResponse.Close();

srCPResponse = null;

Response.Write(strCPResponse);  //Test the server response, IE does not like to display the xml.

//Must run error check for "ERROR_CODE" in XML at this point and do something if present

}

catch

{

//Do something with the error here

}

}
 

It is a direct translation of the ASP script shown above.

I'm searching through the source code, and am having a difficult time locating where to start plugging bits in.

Steady as she goes.

Thanks very much for your help, Giles.  Keep up the great work!

 
New Post
3/12/2010 3:39 PM
 
Well it's been months and after researching, communicating and even paying for solutions, I've got nothing. I think I've provided more to developers regarding this technology, than has been provided to me. Putting ads out for the job isn't doing garnering any response. I'm really starting to hate this community. I can tell you all why Wordpress, Drupal, Magento and Joomla are sitting on templatemonster.com and DotNetNuke is Not. Oh and spare me any responses regarding the greatness of DNN. One look at my portfolio and you'll see, I'm well aware of it's greatness. Does nobody in this community (aside from Giles) have any clue about how to do this. I've emailed several of the community's respected leaders seeking a solution, or a recommended specialist and if they respond at all, they're usually telling me they don't know or to try freelancer.com
 
New Post
3/12/2010 3:43 PM
 
Sorry you have had such a difficult time. Please email me direct at nchristy@r2integrated.com to see if we can help. You can check us out at www.r2integrated.com

Nick Christy Director of Technology, r2Integrated
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsStoreStoreLive QuotesLive Quotes


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out