Sorry, it seems I was a quite hasty:<div><br></div><div>__out_header__ = RespHeader</div><div><br></div><div>This fixed the problem when added inside HelloWorldService class.</div><div><br></div><div>But I am really still curious about whether or not this is the correct way to go. I would appreciate your comments.<br>
<br><div class="gmail_quote">On Fri, May 25, 2012 at 7:45 PM, Mehmet Arikkan <span dir="ltr">&lt;<a href="mailto:marikkan@gmail.com" target="_blank">marikkan@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I tried to add a simple header to the helloworld application:<div><br></div><div><div>class RespHeader(ComplexModel):</div><div>    __namespace__ = &#39;rpclib.examples.hello.soap&#39;</div><div><br></div><div>    Elem1 = Mandatory.String</div>

<div>    Elem2 = Mandatory.String</div><div><br></div><div><div>def _on_method_call(ctx):</div><div>    ctx.out_header = RespHeader()</div><div>    ctx.out_header.Elem1 = &#39;Test1&#39;</div><div>    ctx.out_header.Elem2 = &#39;Test2&#39;   </div>

<div><br></div><div>HelloWorldService.event_manager.add_listener(&#39;method_call&#39;, _on_method_call)</div></div><div><br></div><div>So now when I run the server and make a request with the Suds client, I get a response but no header and along with the following message:</div>

<div><br></div><div>WARNING:rpclib.protocol.soap.soap11:Skipping soap response header as &#39;say_hello&#39; method is not declared to have one.</div><div><br></div><div>When I searched in the code, it seems, ctx.descriptor.out_header is None. But the documentation says for descriptor:</div>

<div><br></div><div>descriptor</div><div>The MethodDescriptor object representing the current method. This object should not be changed by the user code.</div><div><br></div>So how to nail this?? Also, any docs/examples for the sampe usage?</div>

<div><br></div><div>Thanks in advance.</div><div><span class="HOEnZb"><font color="#888888">Mehmet</font></span><div><div class="h5"><br><div class="gmail_quote">On Thu, May 24, 2012 at 12:31 AM, Burak Arslan <span dir="ltr">&lt;<a href="mailto:burak.arslan@arskom.com.tr" target="_blank">burak.arslan@arskom.com.tr</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 05/23/12 18:58, Wolfgang Sourdeau wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le 12-05-23 11:56, Mehmet Arikkan a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I see a &quot;FIXME&quot; in the trunk as such (in soap11.py):<br>
<br>
# FIXME: There&#39;s no way to alter soap response headers for the user.<br>
<br>
</blockquote></blockquote>
<br></div>
yes, but look at it in its context:<br>
<br>
        if ctx.out_error is not None:<div><br>
            # FIXME: There&#39;s no way to alter soap response headers for the user.<br>
<br>
<br></div>
so that&#39;s true only in case the use code throws an exception...<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there no way to alter SOAP Header (i.. add elements) or if there is, how can we do it easily?<br>
<br>
<br>
</blockquote>
<br>
<br>
>From my experience, it is possible to modify the response headers by using the rpc decorator rather than srpc and then modifying the ctx.out_header attribute.<br>
That is, if we are talking stricly about the SOPE layer, and not the HTTP layer...<br>
<br>
</blockquote>
<br></div>
that&#39;s correct. in http you have ctx.transport.resp_headers dict but no ctx.out_header support yet.<span><font color="#888888"><br>
<br>
burak</font></span><div><div><br>
<br>
______________________________<u></u>_________________<br>
Soap mailing list<br>
<a href="mailto:Soap@python.org" target="_blank">Soap@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/soap" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/soap</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>