XMLSearch help - xpath not working as expected
Hello, I am developing using CF9. I am fetching RSS feed from twitter but XmlSearch is unable to return array of entry elements in the xml. Please look into the following code: I can't be using CFFEED tag, since this project has to work on a CF 7 server. cfset sourceUrl = http://search.twitter.com/search.atom?lang=enq=ColdFusion+OR+%23CF+OR+CFML; / cfhttp result=feedRaw url = #sourceUrl# timeout=60 / cfset feed = XMLParse(trim(feedRaw.fileContent), false) / The above part works fine. Problem is that none of the following lines work as expected. I expect to get an array of xml elements entry. cfset items = xmlSearch(feed, //entry) / I have also tried using: 1. //feed/entry 2. /feed/entry 3. entry 4. /*/entry 5. //*/entry Nothing is helping. If you read W3C's page () you'll see various examples, all of them are failing. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327663 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: XMLSearch help - xpath not working as expected
Thanks for responding Isaac. I was using an Atom feed and therefore had to use entry instead of item. It worked following the other advice. Best Sam ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327671 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: XMLSearch help - xpath not working as expected
I think this will be to do with the default namespace in the xml document. A quick google should tell you all you need to know on that, but the upshot is that you will need to use a colon (e.g. a blank namespace) before entity names, i.e.: cfset items = XmlSearch(feed, '//:entry') / HTH Dominic 2009/10/26 Sameer Gupta guptasam...@msn.com Thanks. It worked with /:feed/:entry cfset items = XmlSearch(feed, /:feed/:entry) / Best Sameer ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327672 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFDIRECTORY and Multiple Spaces Between Filename
What I can suggest you is to surrround your output with pre#name#/pre so all spaces are intact in the browser display. The issue is only with browser displaying it after ignoring whitespaces. In HTML, the following will be displayed as breaksplease: b breaks please /b You can't expect your manual line-breaks automatically convert to br / tag. Sam Adobe Certified Flash and Advanced ColdFusion Developer Running CFMX7.0.2. Not sure if this applies to other versions, but have you noticed that if you have two files in a directory, say: whatever whatever.txt (one space between names) whatever whatever.txt (two spaces between names) and if you do CFDIRECTORY in this directory, the NAME column will list both files as: whatever whatever.txt whatever whatever.txt I can't possibly be the first one to notice this, right? And somebody must have a workaround...right? Please? Pretty please? - Sung ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307323 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Using addSOAPResponseHeader fails generation of WSDL
Hi I am working on a web service exposed for use in an .Net application. ..Net guys are telling me that they can not send just any header to me in their request to the WS. Any soap-header must be defined in the WSDL. If it were a .net web service they would have used a line similar to this: [SoapHeader (Credentials)] In ColdFusion, I believe (which may not be the case) we have addSOAPResponseHeader method to achieve the same result. When I use it I can access the page directly MyService.cfc but it throws error while viewing the wsdl MyService.cfc?wsdl. :( = AXIS error Sorry, something seems to have gone wrong... here are the details: Fault - Error attempting to create Java skeleton for CFC web service; nested exception is: coldfusion.xml.rpc.CFCInvocationException: [java.lang.NullPointerException : null] AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultSubcode: faultString: Error attempting to create Java skeleton for CFC web service; nested exception is: coldfusion.xml.rpc.CFCInvocationException: [java.lang.NullPointerException : null] faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:WI040 === Here's my code: cfscript if(IsSOAPRequest()) { // this.soapResponseHeaderXml = XmlParse('IDSResponseHeaderApplicationID/ApplicationIDSignature/Signature/IDSResponseHeader'); AddSOAPResponseHeader(http://www.ids.com/IntouchDataService/;, ApplicationID, , false); AddSOAPResponseHeader(http://www.ids.com/IntouchDataService/;, Signature, , false); } /cfscript I have also tried giving default values, as well as using the XML. Thanks Sameer Gupta ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303384 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using addSOAPResponseHeader fails generation of WSDL
I am working on a web service exposed for use in an .Net application. Can you post the entire code of your CFC method? I have tried this piece of code just inside cfcomponent as well as have tried placing it inside a CFC method. cfscript if(IsSOAPRequest()) { AddSOAPResponseHeader(http://www.ids.com/IDS/;, ApplicationID, , false); AddSOAPResponseHeader(http://www.ids.com/IDS/;, Signature, , false); } /cfscript Here's the complete code: cfcomponent displayname=IDS namespace=http://www.ids.com/IDS/; access=remote bindingname=IDS cfprocessingdirective pageencoding = utf-8 / cfsetting showdebugoutput=no enablecfoutputonly=yes / cffunction name=getApplicationName access=remote returntype=string output=no cfreturn Application.$APPLICATION_NAME / /cffunction cffunction name=getWhatsNew access=remote returntype=string cfargument name=sUserLdapAlias type=string required=yes displayname=User LDAP / cfset var iBusinessId = 0 / cfset var iSegmentId = 0 / cfscript if(IsSOAPRequest()) { AddSOAPResponseHeader(http://www.ids.com/IDS/;, ApplicationID, , false); AddSOAPResponseHeader(http://www.ids.com/IDS/;, Signature, , false); } /cfscript /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303392 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4