This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1]
1
The Rest - Ask For Help / Retrieving a PNG
« on: July 19, 2012, 05:57:14 AM »
Trying to download the png at http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png
but my Page contains html header info. How do I fetch the png out of it?
In the Page Received method, I have:
HTTP/1.1 200 OK
Cache-Control: max-age=7776000
Content-Type: image/png
Last-Modified: Tue, 20 Apr 2010 07:45:44 GMT
ETag: "0c4607b5de0ca1:0"
Server: Microsoft-IIS/7.5
Date: Thu, 19 Jul 2012 13:40:32 GMT
X-Varnish: 1596931882 1596702794
Age: 209
Connection: close
X-Powered-By: UKFast Webcelerator
‰PNG
(and all the non-ascii stuff)
but my Page contains html header info. How do I fetch the png out of it?
In the Page Received method, I have:
Code: [Select]
fn = DG:CommonFolder & '\' & fn
CREATE(RF)
OPEN(RF)
RF.Record.B = WC.Page [1 : WC.PageLen]
ADD(RF,WC.PageLen)
CLOSE(RF)
HTTP/1.1 200 OK
Cache-Control: max-age=7776000
Content-Type: image/png
Last-Modified: Tue, 20 Apr 2010 07:45:44 GMT
ETag: "0c4607b5de0ca1:0"
Server: Microsoft-IIS/7.5
Date: Thu, 19 Jul 2012 13:40:32 GMT
X-Varnish: 1596931882 1596702794
Age: 209
Connection: close
X-Powered-By: UKFast Webcelerator
‰PNG
(and all the non-ascii stuff)
2
Web Server - Ask For Help / Returning a big packet (bigger than 16KB)
« on: January 10, 2012, 09:13:41 AM »
Converting an old file-drop system into a "compatible" web system.
I have a big response to send back that looks like:
HTTP/1.0 200 OK
ContentType: text/xml; charset=utf-8
Content-Length: 16384
<?xml version="1.0"?><TeeQueryResponseFile><ScheduleResponse>
<SRUniqueID>1</SRUniqueID>
<SRDate>20120111</SRDate>
<SRReturn></SRReturn>
<TeeTimes>
<TeeTime><CourseCode>CT</CourseCode><Time>09:30</Time><Hole>1</Hole><Open>3</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>06:28</Time><Hole>1</Hole><Open>2</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>13:42</Time><Hole>1</Hole><Open>1</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>17:12</Time><Hole>1</Hole><Open>4</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>15:06</Time><Hole>1</Hole><Open>1</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>16:02</Time><Hole>1</Hole><Open>2</Open></TeeTime>
and so on and so on for ever and ever amen.
Naturally, it's longer than 16KB.
The code to return it looks like:
TQ PROCEDURE (NetWebServerWorker p_web)
loc:x Long
packet String(NET:MaxBinData)
packetlen Long
CRLF String('<13,10>')
NBSP String(' ')
loc:options String(OptionsStringLen) ! options for jQuery calls
Loc:User long
ThisSecwinAccess string(252)
CODE
GlobalErrors.SetProcedureName('TQ')
p_web.SetValue('_parentPage','TQ')
p_web.publicpage = 1
if p_web.sessionId = 0 then p_web.NewSession().
IF FALSE
do Header
packet = clip(packet) & p_web.BodyOnLoad(p_web.Combine(p_web.site.bodyclass,'PageBody'),,p_web.Combine(p_web.site.bodydivclass,'PageBodyDiv'))
do Footer
packet = clip(packet) & p_web.Popup()
END
packet = WebQuery(p_web.GetValue('xml'))
packet = 'HTTP/1.0 200 OK <13,10>ContentType: text/xml; charset=utf-8<13,10>Content-Length: ' & LEN(CLIP(packet)) & '<13,10><13,10>' & packet
do SendPacket
GlobalErrors.SetProcedureName()
Return
So it looks like I need to send it in more than one packet?
I have a big response to send back that looks like:
HTTP/1.0 200 OK
ContentType: text/xml; charset=utf-8
Content-Length: 16384
<?xml version="1.0"?><TeeQueryResponseFile><ScheduleResponse>
<SRUniqueID>1</SRUniqueID>
<SRDate>20120111</SRDate>
<SRReturn></SRReturn>
<TeeTimes>
<TeeTime><CourseCode>CT</CourseCode><Time>09:30</Time><Hole>1</Hole><Open>3</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>06:28</Time><Hole>1</Hole><Open>2</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>13:42</Time><Hole>1</Hole><Open>1</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>17:12</Time><Hole>1</Hole><Open>4</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>15:06</Time><Hole>1</Hole><Open>1</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>16:02</Time><Hole>1</Hole><Open>2</Open></TeeTime>
and so on and so on for ever and ever amen.
Naturally, it's longer than 16KB.
The code to return it looks like:
TQ PROCEDURE (NetWebServerWorker p_web)
loc:x Long
packet String(NET:MaxBinData)
packetlen Long
CRLF String('<13,10>')
NBSP String(' ')
loc:options String(OptionsStringLen) ! options for jQuery calls
Loc:User long
ThisSecwinAccess string(252)
CODE
GlobalErrors.SetProcedureName('TQ')
p_web.SetValue('_parentPage','TQ')
p_web.publicpage = 1
if p_web.sessionId = 0 then p_web.NewSession().
IF FALSE
do Header
packet = clip(packet) & p_web.BodyOnLoad(p_web.Combine(p_web.site.bodyclass,'PageBody'),,p_web.Combine(p_web.site.bodydivclass,'PageBodyDiv'))
do Footer
packet = clip(packet) & p_web.Popup()
END
packet = WebQuery(p_web.GetValue('xml'))
packet = 'HTTP/1.0 200 OK <13,10>ContentType: text/xml; charset=utf-8<13,10>Content-Length: ' & LEN(CLIP(packet)) & '<13,10><13,10>' & packet
do SendPacket
GlobalErrors.SetProcedureName()
Return
So it looks like I need to send it in more than one packet?
3
Web Server - Ask For Help / The Web Folder appears to be out of date
« on: December 21, 2011, 03:33:12 PM »
Since updating to Nettalk 6, my web folder always appears to be out of date. Also, it runs GZipall each make.
Any way to get rid of these 2 errors and just have it DO it and go on instead of popping up these errors and having to continue?
Using Clarion 6
Any way to get rid of these 2 errors and just have it DO it and go on instead of popping up these errors and having to continue?
Using Clarion 6
4
Your Views and Comments / OT: Who ate the SV Newsgroups?
« on: February 01, 2011, 06:55:31 AM »
Know anything about the Softvelocity Newsgroups? Haven't let me in for 2 weeks now.
5
The Rest - Ask For Help / Netsimple Server : Requests from non-clarion program
« on: November 11, 2010, 01:00:46 PM »
The requests are almost certainly coming from non-clarion as the rest of the world thinks we're all mad
In the Process method, should I use of NET:SimplePartialDataPacket instead of NET:SimpleWholeDataPacket? Is the WholeDataPacket just something you get from another nettalk program, or the normal way to receive requests from things like java, C#, python or whatever the outside program is coded in?
I'm tasked with making a server for outside vendors to send IP messages to and get responses from. Maybe I should just use GET and POST with a web server instead of a netsimple server?
In the Process method, should I use of NET:SimplePartialDataPacket instead of NET:SimpleWholeDataPacket? Is the WholeDataPacket just something you get from another nettalk program, or the normal way to receive requests from things like java, C#, python or whatever the outside program is coded in?
I'm tasked with making a server for outside vendors to send IP messages to and get responses from. Maybe I should just use GET and POST with a web server instead of a netsimple server?
6
The Rest - Ask For Help / Netsimple Server : Multi threading?
« on: November 01, 2010, 12:53:26 PM »
When a packet comes in, I get the request data:
self.WholePacketQueue.WholeBinData
and the reply IP:
self.packet.FromIP
Would it be reasonable to start a thread, put the answer to the request in some queue, and use the send method to send the response back while watching for other requests? (The boss is asking, "Can it be multi-threaded?"
Oh yes, Clarion 6.3 something. Nettalk version 4.53
self.WholePacketQueue.WholeBinData
and the reply IP:
self.packet.FromIP
Would it be reasonable to start a thread, put the answer to the request in some queue, and use the send method to send the response back while watching for other requests? (The boss is asking, "Can it be multi-threaded?"
Oh yes, Clarion 6.3 something. Nettalk version 4.53
Pages: [1]