Title: Help in starting a webserver Post by: Henk vd Boogaard on May 17, 2013, 03:41:57 PM Hello,
I am new to RTC and I have no experience with web communication. I am programming in Delphi and have average experience in it. I hope someone can help me to get started with a project. I have to make a webserver. This webserver is addressed (request) with a Call with a XML-file. The webserver has to check some nodes of the XML-file and the respond by sending a XML-file back The XML-file depends on the information in the request. I know how to read and write a XML-file. Can someone please give me a skeleton of a program that is able to read en send a XML-file? Thanks in advance, Henk van den Boogaard Title: Re: Help in starting a webserver Post by: D.Tkalcec (RTC) on May 17, 2013, 08:56:05 PM Start by reading the following two articles from the RTC Classroom to learn the basics of using RTC components for writing Web Servers:
http://www.realthinclient.com/realthinclient-sdk-demo-1-a-web-server-in-five-minutes/ http://www.realthinclient.com/realthinclient-sdk-sending-dynamically-generated-content/ To read the content body (XML received from the Client), extend the OnDataReceived event of the RtcDataProvider component to use the "Read" method, or the "ReadEx" method on the Sender:TRtcConnection component. In Lesson 2b, the Sender is also accessible through the local rdsServer variable, so you can use this code to get the XML content into a single String variable ... var myXML:RtcString; begin ... myXML := rdsServer.Read; ... RTC components to NOT make a distinction between XML, HTML, CSS, image or binary content. Regardless of the content type you have received, you can always use the Read or ReadEx method inside the OnDataReceived event to read it. And the same goes for sending your content out. Simply use the Write or WriteEx method of the Sender:TRtcConnection component. Best Regards, Danijel Tkalcec |