[Mono-list] XML-RPC listener produces exception on Mono, but works on .NET ("Cannot be changed after headers are sent")

Alan McGovern alan.mcgovern at gmail.com
Tue Dec 18 17:03:52 EST 2007


Technically, you should write the headers before you write the content. That
means you need to set content type and all that *before* you write the
actual data to the response stream. I came across this one recently myself
and filed a bug:

https://bugzilla.novell.com/show_bug.cgi?id=343915

Unfortunately it looks like the default MS.NET behavior is buggy, in that it
lets you set content type even though the headers are already sent and the
receiver will never see that new value.

Alan.

On Dec 18, 2007 9:46 PM, Adam Tauno Williams <adam at morrison-ind.com> wrote:

> I've created an XML-RPC service using the CookComputing XML-RPC assembly
> as described at - http://www.cookcomputing.com/blog/archives/000572.html
>
> But it doesn't work [correctly] under Mono 1.2.6 whereas it does work
> in .NET.  See -
> http://tech.groups.yahoo.com/group/XMLRPCNET/message/970
>
> On Mono I get -
> Cannot be changed after headers are sent.
>  at System.Net.HttpListenerResponse.set_ContentType (System.String
> value) [0x00039]
> in /tmp/monobuild/build/BUILD/mono-1.2.6
> /mcs/class/System/System.Net/HttpListenerResponse.cs:110
>  at
>
> Whitemice.Hexagonal.RPCResponse.CookComputing.XmlRpc.IHttpResponse.set_ContentType(
> System.String value) [0x00000] in
> /home/awilliam/Works/Hexagonal/RPCResponse.cs:21
>  at CookComputing.XmlRpc.XmlRpcHttpServerProtocol.HandleHttpRequest
> (IHttpRequest httpReq, IHttpResponse httpResp) [0x00000]
>  - every time a request is processed,  although the client does receive
> the response.
>
> The author of the XML-RPC assembly has verified that it works on .NET
> and fails on Mono, see -
> http://tech.groups.yahoo.com/group/XMLRPCNET/message/971
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071218/829e274a/attachment-0001.html 


More information about the Mono-list mailing list