<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Sorry, this came in while I was typing the other response.<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 11/12/15 12:53 PM, Marvin Addison
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACOs9MSQDOCdoipV_X8AWC3Ox7+KFzFwjx+mLW-k3ehKXMD1CA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div><br>
          </div>
          <div>I'm aware of that variant, but SOAP envelope building
            happens way down in HTTPSOAP11Encoder using afaict global
            configuration. </div>
        </div>
      </div>
    </blockquote>
    <br>
    Ah, I was wondering whether you were using the message encoder
    here...<br>
    <br>
    <br>
    <blockquote
cite="mid:CACOs9MSQDOCdoipV_X8AWC3Ox7+KFzFwjx+mLW-k3ehKXMD1CA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div>The main obstacle is that I don't have a very good
            understanding of OpenSAML configuration mechanics. I believe
            I could call
            XMLObjectProviderRegistrySupport#registerObjectProvider to
            do what I want, but seems like a global change when I just
            want a one-off. </div>
        </div>
      </div>
    </blockquote>
    <br>
    Yes, you might be able to do something like that, but please,please
    don't do that in the IdP.  :-)<br>
    <br>
    <br>
    <blockquote
cite="mid:CACOs9MSQDOCdoipV_X8AWC3Ox7+KFzFwjx+mLW-k3ehKXMD1CA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div>Is there any way to achieve that?<br>
          </div>
        </div>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    Yes, the HTTPSOAP11Encoder first attempts to locate an
    already-constructed Envelope in the MessageContext like so:<br>
    <br>
    <tt>    protected Envelope getSOAPEnvelope() {</tt><tt><br>
    </tt><tt>        return
      getMessageContext().getSubcontext(SOAP11Context.class,
      true).getEnvelope();</tt><tt><br>
    </tt><tt>    }</tt><br>
    <br>
    <br>
    So if you just populate an Envelope instance there in that
    subcontext before calling the Encoder, that should work.  It will
    also re-use the Body instance that is there in that Envelope.  So
    just doing that should give you a localized solution for this.<br>
  </body>
</html>