|
 |
|
|
This code still saved me a ton of time so you still get my *5*
You need the following change in Address.cs because a zip code response is different :
public static Address FromXml(string xml) { Address a = new Address();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xml);
System.Xml.XmlNode element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/FirmName"); if (element != null) a._FirmName = element.InnerText; element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/Address1"); if (element != null) a._Address1 = element.InnerText; element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/Address2"); if (element != null) a._Address2 = element.InnerText; element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/City"); if (element != null) a._City = element.InnerText; element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/State"); if (element != null) a._State = element.InnerText; element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/Zip5"); if (element != null) a._Zip = element.InnerText; element = doc.SelectSingleNode("/ZipCodeLookupResponse/Address/Zip4"); if (element != null) a._ZipPlus4 = element.InnerText;
return a; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Does anyone know if and where the USPS keeps a list of legitimate "events" when you use the tracking-confirm fields tool?
Rick Martin Bearblu.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, Thanx for the code. I used this code, in my asp.NET web application. but, as i send the request to the testing server with the data u have specified, the server prompts the error as API Authorization failure. DeliveryConfirmationV3 is not a valid API name for this protocol. Does anyone have any idea about this.. ? Please help me..
Thanx
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I'm also having this issue. If anyone has a clue or has been able to solve it please let me know because I am in desperate need of help solving this.
Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I'm running into this issue as well. Calling the ICCC is very little help. They seem to have no idea what this issue is. I thought it might be a problem with the referral url in the http header (one of the ICCC people said something to that sort), but i've set it explicitly and still no change. Is it related to user permissions?
I'm trying with the following urls to no avail. Are these the right urls?
http://testing.shippingapis.com/ShippingAPITest.dll?API=DeliveryConfirmationV3&XML=... https://secure.shippingapis.com/ShippingAPITest.dll?API=DeliveryConfirmationV3&XML=...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
The issue is on their side. I sent an email explaining my situation and they replied. I'll post my email and their reply here:
My Email:
Hello. I've just gotten off the phone with the ICCC and wanted to switch to the production server, but I was told that I needed two successful tries, which I cannot get because I keep getting this error. I've already read the technical guide, and I was also told to send my code to the mail department, and patiently wait, which is what I am doing right now. I've already sent an email but didn't send the code. I am developing using Microsoft Visual C# .NET Framework 1.1. I created a new web application, and added a .dll to the references (MSXML2.dll which can be googled and downloaded easily), which I use for the XML. Here is my code:
private void Page_Load(object sender, System.EventArgs e) { string API = "API=DeliveryConfirmationV3&XML="; string USPSUrl = "https://secure.shippingapis.com/ShippingAPITest.dll?"; string strXML = API + "<DeliveryConfirmationV3.0Request USERID=\"XXXXXX\">\n\n<Option>1</Option>\n\n<ImageParameters />\n\n<FromName>John Smith</FromName>\n\n<FromFirm>U.S. Postal Headquarters</FromFirm>\n\n<FromAddress1 />\n\n<FromAddress2>475 L'Enfant Plaza, SW</FromAddress2>\n\n<FromCity>Washington</FromCity>\n\n<FromState>DC</FromState>\n\n<FromZip5>20260</FromZip5>\n\n<FromZip4>0004</FromZip4>\n\n<ToName>Joe Customer</ToName>\n\n<ToFirm>U.S. Postal Service NCSC</ToFirm>\n\n<ToAddress1>STE 201</ToAddress1>\n\n<ToAddress2>6060 PRIMACY PKWY</ToAddress2>\n\n<ToCity>MEMPHIS</ToCity>\n\n<ToState>TN</ToState>\n\n<ToZip5>38119</ToZip5>\n\n<ToZip4>5718</ToZip4>\n\n<WeightInOunces>2</WeightInOunces>\n\n<ServiceType>Priority</ServiceType>\n\n<POZipCode>20260</POZipCode>\n\n<ImageType>TIF</ImageType>\n\n<LabelDate>07/08/2004</LabelDate>\n\n<CustomerRefNo>A45-3928</CustomerRefNo>\n\n<AddressServiceRequested>TRUE</AddressServiceRequested>\n\n</DeliveryConfirmationV3.0Request>";
MSXML2.XMLHTTPClass XMLhttp = new MSXML2.XMLHTTPClass(); XMLhttp.open("POST", USPSUrl, false, null, null); XMLhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); XMLhttp.send(strXML);
string responseMsg = XMLhttp.responseText; string HTTPStatusText = XMLhttp.statusText; int HTTPStatusCode = XMLhttp.status;
Response.Write(responseMsg);
}
Any help is appreciated. I hope this issue can be solved. Thank you.
--
ICCC's reply:
Thank you for contacting the USPS Internet Customer Care Center in regards to Web Tools ID XXXXXXX.
I apologize, it is not currently possible to generate a label from our test servers. Your profile has been updated to allow you access to the Production Server, and you can test your code using sample labels.
1. The Production Server URL is:
http://production.shippingapis.com.
2. Labels require a secure connection. Please use our secure server:
https://secure.shippingapis.com.
3. There is a line of code that refers to "shippingapitest.dll". You'll need to remove the word "test".
Please refer to the "Run Sample Requests" section of our technical guides for more information on generating sample labels:
http://www.usps.com/webtools/technical.htm
Once you have finished testing your code and want to be given access to generate live labels, we need to know whether you will be customizing (e.g. adding your logo, changing the layout, etc...) the labels in any way.
If you are using third party software and need assistance, please contact the vendor of the software. They should be able to assist you in obtaining live information using our APIs.
If you have any additional questions or concerns please contact us again.
--
I hope this helps
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, Is it possible to get the Delivery Point of an address? I 've been banging my head on this. I can't seem to find the formuls in the CASS doc.
Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I have downloaded your code, compiled and tried to execute it. However the code does not work as is. There is a bug in the USPSManager.cs file. The XML String that is being sent is malformated. Here are the details of the error:
The userid string requires to be enclosed in quotation marks. The code does have the (\") characters to do this. However somehow the escape characters are not being interpreted as escape characters and they show up in the final string as backslashes. Therefore the USPS server sends back a malformatted XML string error.
Has anyone else experienced this?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
I haven't read the USPS API documentation, but quickly glancing over the Address Object I noticed that you had a Character limit of 5 on the ZipPlus4 property. In your comments directly above this section you have "Maximum characters allowed = 4".
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Note that the XML responses for these two requests are different from the AddressVerification request. I added a function to process the GetCityState response:
public static Address CityStateFromXml(string xml) { Address a = new Address();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xml);
System.Xml.XmlNode element = doc.SelectSingleNode("/CityStateLookupResponse/ZipCode/Zip5"); if (element != null) a._Zip = element.InnerText; element = doc.SelectSingleNode("/CityStateLookupResponse/ZipCode/City"); if (element != null) a._City = element.InnerText; element = doc.SelectSingleNode("/CityStateLookupResponse/ZipCode/State"); if (element != null) a._State = element.InnerText;
return a; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I had intended to use this wrapper in a Windows based custom point of sale application, but when I went to have my Webtools account turned on for live transactions, they denied me permission to use the API's in that manner.
Since this wrapper was specifically written for that purpose, I was hoping someone may have fought this battle already. I would appreciate any advice as to how I get approved to use the USPS web tools in a windows application.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I did fight this battle and won! The only thing they won't let you do is address verification unless you agree that it will be in conjunction with USPS shipping.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thank you for the very quick reply.
The specific functionality is that I would like to use that service for the city/state lookup. Is that included under the address verification you are referring to?
I see from your web site that you have experience in creating shipping software to interface with DHL as well. If I am unable to plead my case do you have any other suggestions on how to accomplish this.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
There may be other items that we could build into the application in the future, but for right now, yes that is what I am trying to do.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Thanks for the suggestion. I do not yet know if anything in that particular solution will be anything I can use, however reading some of the threads there led me to find an inexpensive, updated list/database I can purchase, and I can utilize the way I need from there.
In the event that it benefits anyone else, these guys seem to have some lists that are simple, inexpensive, and up to date. I believe this may be the correct fit for my application.
www.zipcodedownload.com
Thanks to everyone for input on this subject.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Sorry to hijack your thread, but I'm curious how you were able to get SSL working? I ran into problems right away trying to use the wrapper from a WinForms app.
If you have any info or tips, I would REALLY appreciate it if you could share your solution.
Thanks and again, apologies for injecting my question into this thread.
-Steve
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Steve,
I have yet to get approved to use the live servers so maybe I do not have everything working.
In the test environment, you may only send "canned" transactions. Which is to say the documentation outlines two or so for kind of transaction. I can only "lookup" the city and state for two given area codes, 90210 and one from Vermont. I am able to successfully submit and retrieve that information, but perhaps I am not in the production environment....if I cannot successfully get approved for that I will never know.
Have you received approval from USPS to use in a WinForms App? If so, how did you approach it?
Thanks, Andrew
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
I haven't even tried to use the production server yet, I'm unable to connect to the test server. I haven't tried to get approval yet, I first need to get the basics working, then get internal approval... THEN deal with the peeps over at USPS. Not looking forward to it at all! 
-Steve
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I had no trouble just last week..late last week using the test servers referred to in the application. Curious to see what the results of the ticket are.
Andrew
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I think the problem might be that I'm trying to use the label Web Tool, not the zip code lookup. I will try and use the zip code side of things and see if I can connect.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Steve,
It likes like there is something else going on here. I was unable to connect to the production environment as well. I have logged an issue with USPS and am awaiting there response.
I will let you know as soon as I here something.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |