RE: Breaking up a DB query into pages
In SQL Server 2005 you could use: Page 1: SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY person) AS rownum, fname, lname FROM Emp) AS tabel1 WHERE rownum = 1 AND rownum = 9 Page 2: SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY person) AS rownum, fname, lname FROM Emp) AS tabel1 WHERE rownum = 10 AND rownum = 19 Dharmendar Kumar Email/ Fax Communications: http://www.realmagnet.com Web Development: http://www.daksatech.com -Original Message- From: Andy Matthews Date: Mon, 16 Jul 2007 08:11:17 -0500 Thread: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:52512#283745 Depends on which database you're using. With mySQL, you can do this: SELECT id, name FROM tablename LIMIT 0,9 The 0 indicates where to start, and the 9 indicates how many records to return. Used in conjunction with a URL based paging system, that query might look like this: SELECT id, name FROM tablename LIMIT cfqueryparam value=#URL.page# cfsqltype=cf_sql_integer,9 Hi What would be the best way to only show 9 results from a DB query on a page and then have a next button and show the next 9 there after, and so on. Do I have to read the query into a structure or is there a way I can use the cfloop function. Thanks! Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.1 - Release Date: 7/6/2007 12:00 AM ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283752 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: MSSQL 2000 Code review and best practices
You can try Microsoft Best Practices Analyzer Tool for Microsoft SQL Server 2000 http://www.microsoft.com/downloads/details.aspx?FamilyID=b352eb1f-d3ca-44ee- 893e-9e07339c1f22displaylang=en hth, Dharmendar Kumar Email/ Fax Communications: http://www.realmagnet.com Web Development: http://www.daksatech.com Subject: MSSQL 2000 Code review and best practices From: DURETTE, STEVEN J (ATTASIAIT) Date: Tue, 10 Jul 2007 07:54:20 -0400 Thread: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:52463#283381 Hey all, For quite a while now, the group I work in has been doing code reviews of our ColdFusion code through the use of a code review tool to pick up the major stuff, then peer review to get the logic/other problems. Now we have to start doing it for SQL code. Does anyone know of any code review tool for SQL Server stored procedures? How about any best practices for sql code? Thanks, Steve ~| ColdFusion MX7 by AdobeĀ® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283580 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
webservices authentication
Hi! I am trying to secure a webservice that I have created. basically I need client apps to call a authenticate() function that would verify the users and pass a token back to the client. In subsequent calls, they would then pass the token back to the webservice in the header. And in my webservice I would check for a valid token. My problem is, I am not sure which is the best place to check for valid tokens? Should I check for valid toekns within each function? Or can I do somethign so that on every call, the component automatically cheks for the valid token? What other methods are people using for securing their apps and to maintain state in a webservice? Any ideas Thanks, Dharm == See forgotten passwords befind asterisks: www.SeePassword.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220123 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: webservices authentication
Dharmendar Kumar | Lead Developer Real Magnet | Advanced Broadcast E-mail and Fax Solutions 4853 Cordell Ave., PH 11, Bethesda, MD 20814 Phone: 301-652-4025 | Fax: 301-652-7153 E-mail: [EMAIL PROTECTED] Website: www.realmagnet.com Adam, How would I set up a proxy service? Do you mean set up servive A and service B. Client apps access servivce A and if token is valid, sent request to servive B. Servie B then sends response back to A and A sends response back to client app? Kevin, How have you implemented this? Using CFLOGIN? Can you show me some sample code? Tom, How would you capture the token being passed in the header in application.cfm? ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220140 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Web service security / session mgmt
With reference to this thread: http://www.houseoffusion.com/cf_lists/messages.cfm/forumid:4/threadid:37 816 Can somone shed some more light on how to do this? Let's say I have an authenticate method that returns a token. The client first has to call this method, get the token, and in subsequent method calls, they have to pass the token in the header. Now where exactly do I check to see if the token is valid? Do I write a function and call this function from within each function? Or is there a way to automatically call this function everytime the service is called? Some sample code would definitely help a lot Thanks you all for your insight. DK == See forgotten passwords befind asterisks: www.SeePassword.com ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219753 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: CF-Talk: Digest every 2 hours
Dharmendar Kumar | Lead Developer Real Magnet | Advanced Broadcast E-mail and Fax Solutions 4853 Cordell Ave., PH 11, Bethesda, MD 20814 Phone: 301-652-4025 | Fax: 301-652-7153 E-mail: [EMAIL PROTECTED] Website: www.realmagnet.com I found this article that deals with web services security: http://www.webreference.com/programming/coldfusion/2/4.html But I still cannot get it to work. The sample code presented throws a windows authentication dialox box een if I pass the username/ password attribute in the CFINVOKE tag when calling the webservice. Is there a different way to pass the username/ password for the cflogin tag to recognize it. Basically cflogin.username and cflogin.password are empty even though I have specified the username/ password in cfinvoke... Any ideas, anyone? Thanks, DK ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219796 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Query to XML
Hi! The method recommended by Macromedia as per their docs is to use CFXML and looping thro your recordset is definitely not the best one - its very bad at performance. CFWDDX does not generate xml in the format i need - so I will have to parse the xml generated by wddx and then use xslt to transform it - not a very efficient way either. I am going to try SQL Servers xml functions to see what kind of performance i get from it. Meanwhile, if anyone knows of any other way of doing this, I would really appreciate it if you can share it... Thanks, DK http://www.realmagnet.com/assets/images/magnet-only.jpg Dharmendar Kumar | Lead Developer Real Magnet | Advanced Broadcast E-mail and Fax Solutions 4853 Cordell Ave., PH 11, Bethesda, MD 20814 Phone: 301-652-4025 | Fax: 301-652-7153 E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Website: www.realmagnet.com http://www.realmagnet.com/ ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218701 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: sharing huge amount of data per webservice
Passing the resultset (~ million rows) from DB to CF may not work (unless you break it up). You could use the DB to write the file and then pass the file to CF. For eg, in SQL Server, you could create a DTS package. Export stuff out of your database, write to a file, FTP the file to the webserver, pass the file path to the web service caller. If the file is very big, you could zip it up and pass the zipped file around. Also, you may want to use asynchronous Web services for this kind of work - so your web service client does not have to wait till your servers do the work. Dharmendar Kumar (DK) -Original Message- From: Joerg Zimmer [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 09, 2005 7:42 AM To: CF-Talk Subject: Re: sharing huge amount of data per webservice hi, 1) Have one method that says howmany rows there are, then another that returns N rows starting at offset M. We already applied arguments to the webservice, allowing to control start and end-date and to specify a participant. However, some participants managed to create 80,000 Rows for them alone. 2) Write the file to somewhere the web server can see it, and use the webservice to indicate the location of the file. To create this file I would have to generate it's content in a variables and write this variable into the file. Would result in an outofmemory error again. something like cffile action=write file=C:\test here goes the content /cffile would be great :) ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214167 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: FTP and file permissions
Try turning off/on passive mode. -Original Message- From: Scott Brady [mailto:[EMAIL PROTECTED] Sent: Friday, August 05, 2005 10:36 AM To: CF-Talk Subject: Fwd: FTP and file permissions Well, it's been a month and we are still having this problem. Has NO ONE ever heard of an instance where logging in to an ftp server manually (with the same credentials) allows you to see files in a directory but CFFTP won't? Scott -- Forwarded message -- From: Scott Brady [EMAIL PROTECTED] Date: Jul 1, 2005 1:19 PM Subject: FTP and file permissions To: cf-talk@houseoffusion.com This is a follow-up to my posts from yesterday. One of our clients pushes a daily data feed to their FTP server, which we log in to using a scheduled task in CF and download the file and process the data feed. Since we upgraded to CF7, it appears that CF's FTP connection can't see that file (neither a directory listing nor a File Exists can seee it). If I manually log into the FTP server (using the exact same username and password), I'm able to see the file. If I then copy the file to some other name, CF can now see the new file. If I delete the original and rename the copy back to the original's name, CF can now see the file under the original name. To me, this sounds like some weird permissions issue, but why would I be able to see the file when manually FTP-ing in with the same exact credentials? Any ideas? Scott -- - Scott Brady http://www.scottbrady.net/ ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213862 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
web service: restricting possible values
Using CF web services, is it even possible to restrict the values in an element. The WSDL spec says I can use a restriction base and enumeration's to define the possible values. Something like this: s:simpleType name=CheckEmailResult s:restriction base=s:string s:enumeration value=Valid / s:enumeration value=InvalidUser / s:enumeration value=InvalidAddress / s:enumeration value=InvalidServer / s:enumeration value=Error / /s:restriction /s:simpleType Is this even possible in ColdFusion? Thanks, DK == See forgotten passwords befind asterisks: www.SeePassword.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213880 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: problem with web service returntype=xml
Yes, I can return string - pass XML string and it works in .Net But I wanted to pass a XML document object - so the receiver doesnt have to parse thro' the xml. But you made an interesteing point - that .net may not support 'document' type - i will investigate if that indeed is the case meanwhile, any other insight is appreciated. Thanks DK -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 2:21 PM To: CF-Talk Subject: Re: problem with web service returntype=xml Try just returning 'string'. The 'document' type probably isn't supported by .NET, but the string type should be equivalent enough. Differences include a little extra work on both ends to seriealize/deserialize the XML, and the inability to access the inner-document as XML while the SOAP packet is in transit, but those probably won't matter. cheers, barneyb On 8/4/05, dk @ realmagnet. com dk @ realmagnet. com [EMAIL PROTECTED] wrote: I have a webservice as follows: cfcomponent cffunction name=test returntype=xml access=remote cfsavecontent variable=a datanameDK/name/data /cfsavecontent cfreturn xmlparse(a) /cffunction /cfcomponent I am able to call it from ColdFusion but not from ASP.Net. When I try to add the web reference in Visual Studio, I get this error: Custom tool error: Unable to import WebService/Schema. Unable to import binding 'test.cfcSoapBinding' from namespace 'http://ws.mm_api'. Unable to import operation 'test1'. The datatype 'Document' is missing. Basically looks like returntype XML from cffunction results in the wsdl to return apachesoap: Document (see below): - wsdl:message name=test1Response wsdl: part name=test1Return type=apachesoap: Document / /wsdl:message The wsdl definition defines apachesoap as: xmlns:apachesoap = http://xml.apache.org/xml-soap; See wsdl below. Still .Net is not able to resolve Document type. Any ideas whats happening here?? Or how I could resolve this? Thanks, DK -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213779 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: problem with web service returntype=xml
Hi Barney, Thanks for the insight. You are dead right on that. Also, I checked .net - and it certainly does not support 'document' type. I will go with your recommendations. Thanks. On another note, about web services architecture - is it better to have all your methods in one wsdl - or does it make more sense to have different services for different modules in your app.? So if I have an intranet with foll. modules: employees customers products Does it make more sense to have 3 diff. web services; each with related methods? Or is better to have just one service? Thanks, DK -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 3:03 PM To: CF-Talk Subject: Re: problem with web service returntype=xml The .NET side is going to have to parse the XML either way. Web servies only every pass text around, they can't pass around objects. So you're not passing a CF XML document object with type=xml, you're passing a nested XML document. The XML document will be part of the SOAP document (with type=xml), rather than an XML-escaped string in the SOAP document (with type=string). So using type=xml will only save you the XML-unescaping on the receiving end, not parsing the XML. Here's a completely contrived example that has little basis in reality, but which will illustrate the point: passing with type=xml: soap var name=myDoc rootOfDoc childInDoc / /rootOfDoc /var /soap passing type=string: soap var name=myDoc lt;rootOfDocgt;lt;childInDoc /gt;lt;/rootOfDocgt; /var /soap cheers, barneyb On 8/4/05, Dharmendar Kumar [EMAIL PROTECTED] wrote: Yes, I can return string - pass XML string and it works in .Net But I wanted to pass a XML document object - so the receiver doesnt have to parse thro' the xml. But you made an interesteing point - that .net may not support 'document' type - i will investigate if that indeed is the case meanwhile, any other insight is appreciated. Thanks DK -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213786 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Missing value in the Form.Fieldnames variable
I have noticed this too Form.Fieldnames variable gives wrong results if you have a field name that ends with date. So if you have a field called s_date - the form.FIELDNAMES variable will not have that as a value. Looks like a bug... i just renamed my fields and it worked. DK -Original Message- From: Tom McNeer [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 4:33 PM To: CF-Talk Subject: Missing value in the Form.Fieldnames variable Just curious if anyone else has experienced this: I was looping over the fields of a submitted form using the Form.Fieldnames variable, and I noticed that there were missing fieldnames. When I looped over StructKeyList(form), the fieldnames were all there. I couldn't find any commonality among the missing fields except that they contained date values (or empty strings, for omitted date values). Both had been run through the cfform validate=date routine. Or more correctly, both fields had those routines assigned, although values were not required in the fields. I don't know if this had any impact on the missing fields or not, but they were the only ones missing. This was on a server running CFMX 6.1. Has anyone seen this behavior, or have any thoughts on why it might have occurred? -- Thanks, Tom Tom McNeer MediumCool http://www.mediumcool.com 530 Means St NW, Suite 110 Atlanta, GA 30318 404.589.0560 ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213815 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54