Code fails in ColdFusion 10, works in CF 8

Posted on 2013-08-31
Medium Priority
Last Modified: 2013-09-01
We have these two templates
on  CF8 http://fullpartner2.com/reset.cfm and on
CF10 CF10 http://fullpartner6.com/reset.cfm

The code works on CF8 and returns garbage characters in "filecontent" on CF10

Any idea why?

Here is the complete SOAP envelope and code:

<cfset XMLpacket='<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pur="http://PurolatorServices.com/">
            <pur:OrderNumber>Test Rate 1</pur:OrderNumber>
            <pur:Ref1>MyRef 001</pur:Ref1>
            <pur:Ref2>Note 001</pur:Ref2>
               <pur:Company>Green Pasture</pur:Company>
               <pur:Add1>416 East Fremont</pur:Add1>
               <pur:Phone>402-858-4818 ext 1</pur:Phone>
               <pur:Name>A Test Person</pur:Name>
               <pur:Add1>3011 Mission Hill Dr</pur:Add1>
               <pur:PostalCode>L5M 0B8</pur:PostalCode>
                  <pur:Weight> 1.0</pur:Weight>
                  <pur:CustomsDesc>brief description</pur:CustomsDesc>
                  <pur:ExtendedDesc>item description</pur:ExtendedDesc>

      <cfset locals.URL="http://www.purolatorshipping.com/WebServices/ShippingServices.asmx?WSDL">
        <cfhttp url="#locals.URL#" port="80" method ="POST" throwonerror="yes" result="httpResponse">
                  <cfhttpparam type="Header" name="Accept-Encoding" Value="gzip,deflate">
                  <cfhttpparam type="Header" name="TE" value="gzip,deflate">
                  <cfhttpparam type="Header" name="Content-Length" value="#len(XMLPacket)#">
            <cfhttpparam name="name" type="XML" value="#XMLPacket#">
                  <cfdump var="#XMLpacket#">
                  <cfdump var="#cfcatch#">
                  <cfset locals.error=1>
<cfif NOT ISDefined("locals.error")>
      <cfdump var="#httpResponse#">


Question by:tednevels
  • 2
  • 2
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39455852
Hi there Ted, I tested your code on all Environments, it seems to be a Bug, I tested on CF9,CF8,CF10 and it is actually showing garbage characters in CF10

Let me do bit of more Testing and I will be answer your query, Else you can log the Bug with Adobe
LVL 53

Accepted Solution

_agx_ earned 2000 total points
ID: 39456777
The garbage characters are just the raw gzip response. You can see it in the response dump:

        Cache-Control       private, max-age=0
        Connection       close
        Content-Encoding       gzip

Change accept-encoding to "*" and it decodes or deflates properly. See the comments by Dan for more details.

        <cfhttp url="#locals.URL#" port="80" method ="POST" throwonerror="yes" result="httpResponse">
                  <cfhttpparam type="Header" name="Accept-Encoding" Value="*">
                  <cfhttpparam type="Header" name="TE" value="deflate;q=0">
                  <cfhttpparam type="Header" name="Content-Length" value="#len(XMLPacket)#">
                 <cfhttpparam name="name" type="XML" value="#XMLPacket#">

Author Closing Comment

ID: 39456814
Thank you! excellent solution
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39456822
Hi Agx, Really Man, I leaned something new Today,

LVL 53

Expert Comment

ID: 39457356
> decodes or deflates properly.

Oops... I meant to type decompresses (ie inflates) properly :) .. but you got the gist.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question