iduapple19 Posted August 4, 2013 Share Posted August 4, 2013 I'm having 1 issue that is keeping me from having my USPS Methods 5.2+ module fully working. I'm getting "extra" characters randomly inserted into my USPS xml response. They are typically only 3-4 characters and inserted into the response in 4 or 5 different locations. It causes my preg-match statements to fail after hitting the first one in the USPS response xml code. Most of the time the preg_match statement miss hitting this code but it varies by country. Here's a small section (only 1 service type) of the USPS XML Response email for Canada that shows the issue: ID="26"><Pounds>0</Pounds><Ounces>9.6</Ounces><Machinable>True</Machinable><MailType>ALL</MailType><Container>RECTANGULAR</Container><Size>REGULAR</Size><Width>1</Width><Length>1</Length><Height>1</Height><Girth>0</Girth><Country>CANADA</Country><Postage>64.95</Postage><CommercialPostage>64.95</CommercialPostage><ExtraServices><ExtraService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>True</Available><OnlineAvailable>True</OnlineAvailable><Price> 1f31 0.00</Price><PriceOnline>0.00</PriceOnline><DeclaredValueRequired>True</DeclaredValueRequired></ExtraService></ExtraServices><ValueOfContents>130.00</ValueOfContents><SvcCommitments>3 - 5 business days</SvcCommitments><SvcDescription>Priority Mail Express International<sup>™</sup> Flat Rate Boxes</SvcDescription><MaxDimensions>USPS-Produced Box: 13-5/8" x 11-7/8" x 3-3/8" or 11" x 8-1/2" x 5-1/2"<br>Maximum weight 20 pounds.</MaxDimensions><MaxWeight>20</MaxWeight></Service> As you can see, I'm getting characters inserted in the response. The "1F31" in the middle of the response is causing the issue. In this example, it breaks the insurance preg_match statement and returns NULL vs. $0.00 for the $iinsurance value. All other $iinsurance values for other services are all wrong after hittingthis error. Depending on where the extra characters are inserted into the response, it could affect the service name, postage, sign conformation, insurance, etc. I'm using a modified USPS Methods 5.2+ with oscommerce 2.2 (CRELoaded 6.3+). Using xampp development server. I've already tried to replace my xml.php files (admin/includes/classes & includes/classes) to the ones in USPS Methods 6.1a as they were different. It did not make any difference. I also added the xml_5.php files the both folders and added the code (lines 12-16) from USPS Methods v6.1c to the top of my usps.php -- It's the test for PHP_VERSION >=5.0.0. That also did not make any difference in the problem. Has anyone ever seen this issue and know how to fix it??? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.