<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 05/28/12 10:57, Mehmet Arikkan wrote:
    <blockquote
cite="mid:CAOVa2xAasa8BujkZSm5131KHBKGbNFr819Ya=pSSTNogk8+Sfg@mail.gmail.com"
      type="cite">Hi Burak,
      <div><br>
      </div>
      <div>I have found this answer as well, please don't bother :). I
        guess I have to use @rpc instead of @sprc so that I can include
        ctx variable. Please let me know if I am mistaken.</div>
      <div><br>
      </div>
    </blockquote>
    <br>
    Merhaba,<br>
    <br>
    Yes, you're correct. And in case you think I should make any
    additions to the documentation, please let me know.<br>
    <br>
    Best,<br>
    Burak<br>
    <br>
    <br>
    <blockquote
cite="mid:CAOVa2xAasa8BujkZSm5131KHBKGbNFr819Ya=pSSTNogk8+Sfg@mail.gmail.com"
      type="cite">
      <div>
      </div>
      <div>Regards,</div>
      <div>Mehmet<br>
        <br>
        <div class="gmail_quote">On Mon, May 28, 2012 at 10:34 AM,
          Mehmet Arikkan <span dir="ltr">&lt;<a moz-do-not-send="true"
              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">Hi Burak,
            <div><br>
            </div>
            <div>
              <div class="im">"You could also do it in the user code as
                well, without messing with events at all, in case you
                need to add method-specific headers."<br>
                <br>
              </div>
              Could you please give an example about this method? This
              is what I need. I think I don't have a clear understanding
              on how I can use the "ctx" variable in an @rpc or @srpc
              decorator function.</div>
            <div><br>
            </div>
            <div>Suppose I have two methods A and B and I want to
              include an AHeader and a BHeader in them respectively. How
              can I do that, could you please elaborate with a simple
              example?</div>
            <div><br>
            </div>
            <div>Regards,</div>
            <div>Mehmet</div>
            <div><br>
              <div class="gmail_quote">
                <div>
                  <div class="h5">On Fri, May 25, 2012 at 9:14 PM, Burak
                    Arslan <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:burak.arslan@arskom.com.tr"
                        target="_blank">burak.arslan@arskom.com.tr</a>&gt;</span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <div text="#000000" bgcolor="#FFFFFF">
                        <div> On 05/25/12 21:09, Mehmet Arikkan wrote:
                          <blockquote type="cite">Actually what I meant
                            to ask is that whether my way to add the
                            header is a proper way:
                            <div><br>
                            </div>
                            <div><span
style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">
                                <div>
                                  <div>def _on_method_call(ctx):</div>
                                  <div>    ctx.out_header = RespHeader()</div>
                                  <div>    ctx.out_header.Elem1 =
                                    'Test1'</div>
                                  <div>    ctx.out_header.Elem2 =
                                    'Test2'   </div>
                                  <div><br>
                                  </div>
                                  <div>HelloWorldService.event_manager.add_listener('method_call',

                                    _on_method_call)</div>
                                </div>
                                <div><br>
                                </div>
                                <div>Is this how you would properly add
                                  a SOAP Header to your outgoing
                                  message?</div>
                                <div><br>
                                </div>
                              </span></div>
                          </blockquote>
                          <br>
                        </div>
                        Yes, you could do it like this with events if
                        you want to add that header to every response
                        regardless of the method name. You could also do
                        it in the user code as well, without messing
                        with events at all, in case you need to add
                        method-specific headers.<br>
                        <br>
                        Does that help?<br>
                        <br>
                        Best,<br>
                        Burak<br>
                        <br>
                      </div>
                      <br>
                    </div>
                  </div>
                  <div class="im">_______________________________________________<br>
                    Soap mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:Soap@python.org" target="_blank">Soap@python.org</a><br>
                    <a moz-do-not-send="true"
                      href="http://mail.python.org/mailman/listinfo/soap"
                      target="_blank">http://mail.python.org/mailman/listinfo/soap</a><br>
                    <br>
                  </div>
                </blockquote>
              </div>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>