Re: Extracting data from Java ByteArrayOutputStream
On Fri, Aug 13, 2010 at 2:03 PM, Jeff Chastain wrote: > > Pete, > > This does have me an ASCII string of the contents of the byte array. > After a lot of string parsing, I can get the SOAP envelope out and > convert it to XML. However, the binary images that are also included > here are apparently encoded some how and I have yet to be able to use > any form of ColdFusion decoding process to get them into a readable format. > Jeff the images as Leigh suggested are probably encoded in Base64 format, ColdFusion has functions to deal with base64 built in. You can use ToBinary(base64string) and then you can write the binary data to a file. -- Pete Freitag http://foundeo.com/ - ColdFusion Consulting & Products http://petefreitag.com/ - My Blog http://hackmycf.com - Is your ColdFusion Server Secur ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336295 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Extracting data from Java ByteArrayOutputStream
> the binary images that are also included > here are apparently encoded some how Could they be bas64 encoded? What does the wsdl say about the format of the response elements? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336287 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Extracting data from Java ByteArrayOutputStream
Pete, This does have me an ASCII string of the contents of the byte array. After a lot of string parsing, I can get the SOAP envelope out and convert it to XML. However, the binary images that are also included here are apparently encoded some how and I have yet to be able to use any form of ColdFusion decoding process to get them into a readable format. Is there a better way to covert this byte array / string into something usable within ColdFusion without a bunch of string parsing and decoding? Thanks -- Jeff On 8/13/2010 10:34 AM, Pete Freitag wrote: > This should give you the cfhttp response as a string, when you get > back a byte array: > > cfhttp.filecontent.toString("UTF-8") > > > -- > Pete Freitag > http://foundeo.com/ - ColdFusion Consulting& Products > http://petefreitag.com/ - My Blog > http://hackmycf.com - Is your ColdFusion Server Secure? > > > On Thu, Aug 12, 2010 at 12:22 PM, Jeff Chastain > wrote: >> Dave, >> >> Per my message earlier this week >> (http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336189), >> when I try> AxisFault error that I cannot get around. When I use> getting the expected response back, but in a ByteArrayOutputStream. >> >> Thanks >> -- Jeff >> >> I am working with a SOAP web service in CF 8.0.1 and the filecontent attribute of the cfhttp response is a java.io.ByteArrayOutputStream. If I use the toString() method to convert this to text, I can see the XML response data plus the binary image strings that I was expecting. The problem is, I am not sure how to get this information out of the ByteArrayOutputStream. >>> Out of curiosity, is there a reason why you're using CFHTTP to invoke >>> a SOAP service instead of CFINVOKE? If you can't use CFINVOKE, you can >>> probably just invoke the underlying Axis classes using Java. >>> >>> Dave Watts, CTO, Fig Leaf Software >>> http://www.figleaf.com/ >>> http://training.figleaf.com/ >>> >>> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on >>> GSA Schedule, and provides the highest caliber vendor-authorized >>> instruction at our training centers, online, or onsi >> > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336258 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Extracting data from Java ByteArrayOutputStream
This should give you the cfhttp response as a string, when you get back a byte array: cfhttp.filecontent.toString("UTF-8") -- Pete Freitag http://foundeo.com/ - ColdFusion Consulting & Products http://petefreitag.com/ - My Blog http://hackmycf.com - Is your ColdFusion Server Secure? On Thu, Aug 12, 2010 at 12:22 PM, Jeff Chastain wrote: > > Dave, > > Per my message earlier this week > (http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336189), > when I try AxisFault error that I cannot get around. When I use getting the expected response back, but in a ByteArrayOutputStream. > > Thanks > -- Jeff > > > >> I am working with a SOAP web service in CF 8.0.1 and the filecontent > >> attribute of the cfhttp response is a java.io.ByteArrayOutputStream. If > >> I use the toString() method to convert this to text, I can see the XML > >> response data plus the binary image strings that I was expecting. The > >> problem is, I am not sure how to get this information out of the > >> ByteArrayOutputStream. > > > >Out of curiosity, is there a reason why you're using CFHTTP to invoke > >a SOAP service instead of CFINVOKE? If you can't use CFINVOKE, you can > >probably just invoke the underlying Axis classes using Java. > > > >Dave Watts, CTO, Fig Leaf Software > >http://www.figleaf.com/ > >http://training.figleaf.com/ > > > >Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on > >GSA Schedule, and provides the highest caliber vendor-authorized > >instruction at our training centers, online, or onsi > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336257 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Extracting data from Java ByteArrayOutputStream
Dave, Per my message earlier this week (http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336189), when I try > I am working with a SOAP web service in CF 8.0.1 and the filecontent >> attribute of the cfhttp response is a java.io.ByteArrayOutputStream. If >> I use the toString() method to convert this to text, I can see the XML >> response data plus the binary image strings that I was expecting. The >> problem is, I am not sure how to get this information out of the >> ByteArrayOutputStream. > >Out of curiosity, is there a reason why you're using CFHTTP to invoke >a SOAP service instead of CFINVOKE? If you can't use CFINVOKE, you can >probably just invoke the underlying Axis classes using Java. > >Dave Watts, CTO, Fig Leaf Software >http://www.figleaf.com/ >http://training.figleaf.com/ > >Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on >GSA Schedule, and provides the highest caliber vendor-authorized >instruction at our training centers, online, or onsi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336231 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Extracting data from Java ByteArrayOutputStream
> I am working with a SOAP web service in CF 8.0.1 and the filecontent > attribute of the cfhttp response is a java.io.ByteArrayOutputStream. If > I use the toString() method to convert this to text, I can see the XML > response data plus the binary image strings that I was expecting. The > problem is, I am not sure how to get this information out of the > ByteArrayOutputStream. Out of curiosity, is there a reason why you're using CFHTTP to invoke a SOAP service instead of CFINVOKE? If you can't use CFINVOKE, you can probably just invoke the underlying Axis classes using Java. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336230 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm