Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / February 2005



Tip: Looking for answers? Try searching our database.

XML or WebServices or CFC?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ProWebService - 23 Feb 2005 01:44 GMT
I was wondering if anyone has any experience in XML or WebServices?  Maybe I
need to use CFC's???

What I am trying to do is, attached to this posting is code that is a query
from a database.  The result is just a table with columns and data that is
continuously updated maybe once or twice a day.  I want to built a webservice
or XML code that I can give to other websites and have them be able to input
this code that will read this info from my server and display it on their site.

I am running CFMX and Linux on my server.

Any thoughts on how to do this?

I think XML or Web services is the right way to go but I have no experience in
this area.

I also have no idea what the other sites will have as far as ColdFusion, ASP,
or Flash or some other language that their site is in.

I would appreciate any thoughts that you may have on this.

Thanks,
Tom

<cfquery name="PickSite" datasource="#application.AppDataSource#"
username="#Application.DSNusername#" password="#Application.DSNpassword#">
    Select        BasicSiteSetupID, Member_ID,
                ID, MEMCode,
                Title, FirstName, LastName,
                Address1, Address2,
                City, State, Province, Zipcode, Country,
                Phone, Fax, Website, Username
    From         BasicSiteSetup, Member
    Where        MemberSiteOn = 1 AND Member_ID = ID
    Order By     MemberSiteDate, MemberSiteTime, City
</cfquery>

<table width="100%" border="0" cellspacing="0" cellpadding="1" align="left">
    <cfoutput query="PickSite">
    <tr>
        <cfif isdefined('Title')>
        <td nowrap><font face="Arial,Helvetica,sans-serif" size="1"
color="Black">#Title# #FirstName# #LastName#</font></td>
        <cfelse>
        <td nowrap><font face="Arial,Helvetica,sans-serif" size="1"
color="Black">#LastName#</font></td>
        </cfif>
        <td nowrap><font face="Arial,Helvetica,sans-serif" size="1"
color="Black">#City#</font></td>
        <td nowrap><font face="Arial,Helvetica,sans-serif" size="1"
color="Black">#State# #Province#</font></td>
        <td nowrap><font face="Arial,Helvetica,sans-serif" size="1"
color="Black">#Country#</font></td>
        <td nowrap><a href="http://www.aafo.org/#Username#" target="_blank">
        <font face="Arial,Helvetica,sans-serif" size="1"
color="Blue">http://www.aafo.org/#Username#</font></a></td>
        <cfif Website NEQ ''>
        <td nowrap><a href="http://#Website#" target="_blank"><font
face="Arial,Helvetica,sans-serif" size="1"
color="Blue">http://#Website#</font></a></font></td>
        <cfelse>
        <td>&nbsp;</td>
        </cfif>
    </tr>
    </cfoutput>
</table>
ProWebService - 24 Feb 2005 00:17 GMT
I was looking at Google AdSense and their program.  That is what I want to be
able to accomplish is give someone some html code to put into their website and
have that call up the dynamic table from my server/site to display my data/list
on their site.

Thanks,
Tom
Ike23 - 24 Feb 2005 00:49 GMT
You could try using the CFHTTP and calling the page then writing the results to an HTML file and including that in a page...
ProWebService - 24 Feb 2005 01:39 GMT
Ike23 - thanks for responding.

Let me say this back to you to make sure that I understand you correctly, you
are saying:

On my site that is going to provide the information to other sites, I could
use CFHTTP and call the query that would generate the dynamic page of data,
then write the results of that to an HTML File.  After that is completed on my
page then someone on another server and webstie could all this static HTML page
off of my server and display it on their site?  If this is what you meant is
there an HTML code that will get a file from another server and display it on
their own if they are not running ColdFusion?

Thanks,
Tom
ProWebService - 26 Feb 2005 03:09 GMT
Anyone else have thoughts on this issue?

Thanks,
Tom
davidmedifit - 28 Feb 2005 20:15 GMT
Tom,     What you are looking for (correct me if I am wrong) is for someone to
request the information from YOUR site, to display on THEIR site. The key here
is that THEY are making the request, so CFHTTP won't help you (anyone, please
feel free to contradict me, with an explanation).   No matter what you do, you
need to decide on a method, and the message content/structure. People need to
know this when accessing your data.  If the content is static (like 50 states,
and their capitals), hand code some XML - no need to make life hard on
yourself.   If your data is dynamic, have your code to access / transform it
and output simple, straight XML onto the page. Other programmers could access
it using a HTTPService, like cfhttp in coldFusion (not too sure what ASP, etc
would use).  Personally, I would use a web service, and return an XML string
(research cfxml). I haven't done this yet, but I suppose you could also return
a whole XLST (stylesheet) - but, again, you would have to research this.  The
key here is that the person handling the data will need to know the format of
the data, and present it to THEIR users in a manner that makes sense. You could
post instructions with the web service.   If you decide to use HTML instead,
you would have to construct the HTML, put it into a varuable, and return it.
That sorts out the formatting issues, but make sure you don't use any CSS calls
(the consumer most likely wont have your stylesheet - unless you make THAT
available on the public net!).  The possibilities are endless, I hope I
answered your question a little. Please post back if not.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.