<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Thanks Bob -&nbsp;</div><div><br></div><div>I used your suggestion to revamp the Seaside application for my Second-Life-based client, as an example of subclassing WARequestHandler.</div><div>Following your example worked perfectly. &nbsp;</div><div><br></div><div>Thanks again,</div><div>Jay</div><div><br></div><br><div><div>On Aug 5, 2011, at 3:55 PM, Bob N. wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">We interface with an IVR system by answering VXML. I ended up subclassing&nbsp;WARequestHandler and implemented #handleFiltered: as indicated in the class comments.<div><br></div><div>Here is a simplified version of the method...</div>
<div>handleFiltered: aRequestContext</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| response result request |&nbsp;</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>request := aRequestContext request.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>result := self processCall: request.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>response := aRequestContext response.&nbsp;</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>response&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>contentType: self contentType;&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>nextPutAll: result.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aRequestContext respond.</div><div><br></div><div>...where #processCall: answers a VXML string based on the request contents (using #aRequest&gt;&gt;at:ifPresent:)</div>
<div><br></div><div>That, plus a class initialize method...</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^WAAdmin register: self at: 'IVR'</div><div>...was all that was needed to get started.&nbsp;</div>
<div><br>The same image also serves a full Seaside interface for the IVR application.&nbsp;</div><div><br></div><div>Bob Nemec</div><div><br></div><div><br></div><br><div class="gmail_quote">On Wed, Aug 3, 2011 at 8:01 PM, Jay Hardesty <span dir="ltr">&lt;<a href="mailto:jayh@panix.com">jayh@panix.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>In fact I assume I really need to push this functionality down to the purely HTTP level.</div>
<div><br></div><div>Situation arose because I've been reusing my Seaside apps to serve data to other sorts of clients as well - overkill I guess since I'm not using any generated html in such cases&nbsp;</div><div><div>
</div><div class="h5"><div><br></div><br><div><div>On Aug 4, 2011, at 1:53 AM, Jay Hardesty wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word"><div><div>Thank you for the response, James. &nbsp;&nbsp;</div><div>
<br></div><div>For me, the problem is that I need the XML to be processed automatically (with no dialog).</div><div><br></div><div>Whereas my response from Seaside used to return XML - that is something starting with:</div>
<div><span style="white-space:pre-wrap">        </span>&lt;?xml version="1.0" encoding="UTF-8"?... &nbsp;(because that's how my xmlString starts)</div><div><br></div><div>I instead now see something starting:</div>
<div><span style="white-space:pre-wrap">        &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 </span>...</div><div><br></div><div>For instance the response returned from the code fragment in your response ultimately arrives as the same (html) result&nbsp;</div>
<div><br></div><div>I should mention that this particular request is being sent to my Seaside app from a non-Seaside client; perhaps a Seaside app simply can't be used in such a way anymore(?) &nbsp;</div><div><br></div><div>
Thanks again,</div><div>Jay</div></div><div><br></div><br><div><div>On Aug 4, 2011, at 1:27 AM, James Foster wrote:</div><br><blockquote type="cite"><div>Jay,<br><br>With the following code, clicking on a link will open a dialog asking what application to use to open the document or offering to save the document. This looks close to what you are doing. (I'm using Seaside 3.0.5 in GemStone/S.)<br>
<br>James<br><br><span style="white-space:pre-wrap">        </span>self requestContext respond: [:response |<br><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>| document |<br><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>document := myXmlString seasideMimeDocument<br>
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>mimeType: (WAFileLibrary mimetypeFor: 'xml');<br><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>fileName: 'myNewFile.xml';<br>
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>yourself.<br><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>response <br>
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>document: document;<br><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>doNotCache;<br>
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>yourself.<br><span style="white-space:pre-wrap">        </span>].<br><font><font color="#144FAE"><br>
</font></font></div></blockquote><blockquote type="cite"><div>On Aug 3, 2011, at 4:09 PM, Jay Hardesty wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">Hi - I'm having a problem returning XML as a response from within a Seaside app, after moving to 3.0.<br>
</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I used to return XML by:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span>self session returnResponse: <br>
</blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>(WAResponse new<br></blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>contentType: 'text/xml';<br>
</blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>nextPutAll: xmlString;<br></blockquote><blockquote type="cite">
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>yourself)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">but t in Seaside 3.0 I get: <br>
</blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span>'You can no longer return a new WAResponse instance. You must instead modify the Response contained in the active RequestContext. Look for senders of #respond: and #response for examples.'<br>
</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Following the nearest examples I can find I tried:<br></blockquote><blockquote type="cite"><br></blockquote>
<blockquote type="cite"><span style="white-space:pre-wrap">        </span>self requestContext respond: [:response |<br></blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>| document |<br>
</blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>document := MIMEDocument <br></blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>contentType: 'text/xml';<br>
</blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>content: xmlString.<br></blockquote><blockquote type="cite">
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>response document: document]<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">and:<br></blockquote><blockquote type="cite">
<br></blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span>self requestContext respond: [:response |<br></blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>response<br>
</blockquote><blockquote type="cite"><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>contentType: 'text/xml';<br></blockquote><blockquote type="cite">
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>nextPutAll: xmlString]<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
but in both cases an html document arrives downstream (with XML in the body) rather than the XML itself as previously<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Think I'm missing something basic here... Thanks very much for any pointers,<br>
</blockquote><blockquote type="cite">Jay<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote>
<blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">seaside mailing list<br></blockquote><blockquote type="cite"><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
</blockquote><blockquote type="cite"><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br></blockquote><blockquote type="cite">
<br></blockquote><br>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></blockquote></div><br></div>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br></div></div></div><br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></blockquote></div><br></body></html>