SERIOUS USPS PROBLEM
#1
Posted 28 November 2008, 18:18
Ive looked through the forums, and i couldnt resolve my problem. I need a different solution than what has already been posted about this error.
Additional Details:
1. I have contacted usps them and they have already moved me to production, i have put in my usps id and password into the oscommerce admin for usps module.
2. The module WAS working, then bam! just stopped working after the usps change. not too sure tho if it was usps, since i had slightly modified a few files.
I hope I have given enough details, Any help would be greatly appreciated. I can probably give better details based on your responses.
Thanks alot !
Daniel Losada
#2
Posted 28 November 2008, 20:23
Regards
Jim
#3
Posted 01 December 2008, 06:45
#4
Posted 01 December 2008, 07:21
#5
Posted 01 December 2008, 16:07
I have replaced the shipping files to the original, and i still get an error from a file i didnt touch (the http_client). I know that other people had this same error, but that was a production/test issue. I have already been moved to shipping. USPS changed something tho, i think it was their urls. where is this in the oscommerce.
Anyone with ANY type of info on ANY of the oscommerce files that have to do with shipping, please fill me in. even if its just a list of all the files that have code that, if changed, can mess up the usps shipping calculation on the checkout_shipping.php page.
I would be greatful. I am really stuck. I really rely on this forum to help me fix this problem
#6
Posted 01 December 2008, 18:30
Regards
Jim
#7
Posted 01 December 2008, 18:58
kymation, on Dec 1 2008, 07:30 PM, said:
Regards
Jim
thank you very much. it is not working yet, but i contacted them, and i explained the problem again, til they understood. It turns out they did block it but they have a form that i can fill out to request an "unblock"
its probably it, but ill post back here if anyadditional problems come up. Thanks alot Jim. your very helpful
#8
Posted 08 December 2008, 21:40
#9
Posted 08 December 2008, 22:01
#10
Posted 08 December 2008, 22:03
#11
Posted 08 December 2008, 22:05
minionsweb, on Dec 8 2008, 10:01 PM, said:
so shall i wait for USPS then? and who can i contact about this? Apparently they dont know they are having issues...
#12
Posted 10 December 2008, 15:53
minionsweb, on Dec 8 2008, 05:01 PM, said:
Hey folks,
The shipping api is down, however the rate calculator is available. We provide the rate calculation engine to the folks that provide the shipping api. The shipping api offers numerous services and we are just one of them.
If you require domestic rates calculations, as received by ShippingAPI.dll, you can access our rate engine directly.
Accessing the rate calculator api is very similiar to how you access this functionality from the shipping api.
Getting started:
A simple demo site that will allow you to learn/test a subset the API:
http://postcalc.usps.gov/domSDK/sdkdemo.htm
XML over HTTP Application access:
http://postcalc.usps.gov/SdkXml.aspx
Documentation is available but I do not have a publically available site to post this on. If a site is available, just let me know and I will post the SDK documentation there.
Let me know if I can help.
Adrian Griffith
ManTech Information Systems & Technology
Project Manager, USPS Postal Explorer and Rate Calculators
adrian.griffith@mantech.com
Edited by USPSRateCalc, 10 December 2008, 16:08.
#13
Posted 10 December 2008, 16:19
XML over HTTP Application access:
http://postcalc.usps.gov/SdkXml.aspx
C# Example:
/// <summary>
/// Example of the GetRates Request.
/// </summary>
/// <param name="testOut">StreamWriter for output file</param>
private void TestGetRates(StreamWriter TestOut)
{
// C# HTTP Web Request and Response objects
HttpWebRequest wtReq;
HttpWebResponse wtResp = (HttpWebResponse)null;
HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
// URL for this request
string reqUrl = "";
// an HTTP POST or GET are acceptable
string httpMethod = "POST";
// Some properties to handle formatting the request and output
StringBuilder xmlOutput = new StringBuilder();
StringBuilder example = new StringBuilder();
StringBuilder mClasses = new StringBuilder();
StringBuilder mClassesDesc = new StringBuilder();
StringBuilder xmlTestElement = new StringBuilder();
string poOutput = "";
// Parameters for the GetRates Request
eMailType mailType = eMailType.eLetter;
string origZip = "20151";
string destZip = "20011";
string characteristics = "";
double pounds = 0;
double ounces = 1;
string mailingDate = "-1";
string mailingTime = "-1";
// Future element that will allow the user to request a specific mail class
mClasses.AppendFormat("<MailClass />");
mClassesDesc.AppendFormat("Request all mail services available");
string testType = "GetRates";
++TestId;
// Formatted GetRates Request for output to disk as well as the HTTP Request content
example.AppendFormat("<GetRates TestId='{9}' TestUnitId='{10}'>\r\n" +
"<MailTypeID>{0}</MailTypeID>\r\n" +
"<CharacteristicID>{1}</CharacteristicID>\r\n" +
"<OZIP>{2}</OZIP>\r\n" +
"<DZIP>{3}</DZIP>\r\n" +
"<Pounds>{4}</Pounds>\r\n" +
"<Ounces>{5}</Ounces>\r\n" +
"<MailingDate>{6}</MailingDate>\r\n" +
"<MailingTime>{7}</MailingTime>\r\n" +
"<MailClasses>\r\n" +
"{8}\r\n" +
"</MailClasses>\r\n" +
"</GetRates>",
(int)mailType, characteristics, origZip, destZip, pounds, ounces, mailingDate, mailingTime, mClasses.ToString(),
TestId, TestUnitId);
// Create the HTTP Request content
string reqContent = example.ToString();
reqContent = reqContent.Replace("\r\n", "");
if (httpMethod == "POST")
{
reqUrl = "http://postcalc.usps.gov/SdkXml.aspx";
wtReq = (HttpWebRequest)WebRequest.Create(reqUrl);
// Set some common Request variables
wtReq.KeepAlive = true;
wtReq.CachePolicy = noCachePolicy;
wtReq.Timeout = 10000;
wtReq.Method = httpMethod;
// Build the content for the POST
byte[] byteRequest = Encoding.UTF8.GetBytes(reqContent);
wtReq.ContentType = "application/x-www-form-urlencoded";
wtReq.ContentLength = byteRequest.Length;
Stream dataStream = wtReq.GetRequestStream();
dataStream.Write(byteRequest, 0, byteRequest.Length);
dataStream.Close();
}
else
{
// Append the content for the GET
reqUrl = String.Format("http://postcalc.usps.gov/SdkXml.aspx?Xml={0}", reqContent);
wtReq = (HttpWebRequest)WebRequest.Create(reqUrl);
}
// Set some common Request variables
wtReq.KeepAlive = true;
wtReq.CachePolicy = noCachePolicy;
wtReq.Timeout = 10000;
wtReq.Method = httpMethod;
// Use a DataSet to capture the URL
DataSet ds = new DataSet();
// Might as well collect some performance information
Stopwatch sw = new Stopwatch();
sw.Start();
// Make the Request
try
{
wtResp = (HttpWebResponse)wtReq.GetResponse();
Stream recvStream = wtResp.GetResponseStream();
ds.ReadXml(recvStream);
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (wtResp != (WebResponse)null)
wtResp.Close();
}
sw.Stop();
long elapsedTime = sw.ElapsedMilliseconds;
xmlTestElement.AppendFormat("MailPieceType='{0}' TestType='{1}' " +
"Pounds='{2}' Ounces='{3}' OrigZip='{4}' DestZip='{5}' " +
"MailClasses='{6}' MailTypeId='{7}' MailingDate='{8}' MailingTime='{9}' " +
"TestId='{10}' TestUnitId='{11}' ElapsedMilliseconds='{12}'",
mailType, testType, pounds, ounces, origZip, destZip,
mClassesDesc.ToString(), (int)mailType, mailingDate, mailingTime, TestId, TestUnitId, elapsedTime);
TestOut.WriteLine("<TestXMLSdk " + xmlTestElement.ToString() + ">");
TestOut.WriteLine(example.ToString());
poOutput = ds.GetXml();
poOutput = poOutput.Replace("</MailClass>",
String.Format("<TestId>{0}</TestId>\r\n<TestUnitId>{1}</TestUnitId>\r\n</MailClass>", TestId, TestUnitId));
xmlOutput.Append(poOutput);
TestOut.WriteLine(xmlOutput.ToString());
TestOut.WriteLine("</TestXMLSdk>");
return;
}














