<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:10pt">Brent, I will try to implement the workaround that you have suggested. It would be great if you send an update when this issue is resolved.<br><br>And thanks for the help on how to set up the debugging for the protocol message. I will try that too.<br><br>Thanks!<br><div><span><br></span></div><div><br></div>  <div style="font-family: tahoma, new york, times, serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Brent Putman &lt;putmanb@georgetown.edu&gt;<br> <b><span style="font-weight: bold;">To:</span></b> dev@shibboleth.net <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, December 12, 2012 9:06 PM<br> <b><span style="font-weight:
 bold;">Subject:</span></b> Re: Missing SOAP header in ECP response<br> </font> </div> <br>
<div id="yiv2129084909">
  

    
  
  <div>
    <br>
    <br>
    <div class="yiv2129084909moz-cite-prefix">On 12/12/12 6:13 PM, Mitu Singh wrote:<br>
    </div>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:tahoma, new york, times, serif;font-size:10pt;">Thanks Brent. It would be
        great help if you could look into the code to see if I need to
        change something. <br>
      </div>
    </blockquote>
    <br>
    Ok, I think I know what the issue is.&nbsp; The problem isn't the code
    that's constructing the Envelope, etc, it's the encoder that you are
    using.&nbsp; The SAML 2 binding version of HTTPSOAP11Encoder (meaning
    org.opensaml.saml2.binding.encoding.HTTPSOAP11Encoder) essentially
    doesn't currently allow using SOAP headers, because it
    indiscriminately ignores any SOAP Envelope that you set in the
    message context and instead builds its own.&nbsp; IIRC someone else
    pointed this out once and I actually thought we had fixed that, but
    apparently not.&nbsp; I'll look at doing that.<br>
    <br>
    In the meantime, just try switching to the java-openws impl of
    HTTPSOAP11Encoder which is
    org.opensaml.ws.soap.soap11.encoder.http.HTTPSOAP11Encoder.&nbsp; It
    respects the presence of a pre-existing SOAP Envelope in the message
    context's outbound message slot.&nbsp; I believe the only functional
    difference between them for your purposes is going to be that the
    SAML version sets the HTTP SOAPAction header to
    <a rel="nofollow" class="yiv2129084909moz-txt-link-rfc2396E" target="_blank" href="http://www.oasis-open.org/committees/security">"http://www.oasis-open.org/committees/security"</a>, which is a MAY in
    the SAML 2 bindings spec.&nbsp; The openws one sets it to an empty
    string, unless there is a WS-Addressing Action header set on the
    Envelope, in which case it pulls the action value from that.<br>
    <br>
    In terms of code compatibility, the main difference is going to be
    that the openws one does not implement the SAMLMessageEncoder
    interface, so it doesn't expose the binding URI.<br>
    <br>
    If either or both of those things is important for your purposes,
    you could just trivially subclass the openws one and make it do
    those 2 things. <br>
    <br>
    The biggest difference is that the openws is an impl of
    HandlerChainAware, which is a concept that was introduced after the
    SAML ones in java-opensaml2 were written.&nbsp; They were never
    backported to support that stuff, and probably won't be.<br>
    <br>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:tahoma, new york, times, serif;font-size:10pt;"><br>
        Also, before the message is sent I would like to output the
        message (envelope with header,body and the saml response) to the
        console. How can I achieve this? I can output just the saml
        response using:<br>
        <span class="yiv2129084909tab">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ResponseMarshaller marshaller
        = new ResponseMarshaller();<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Element plaintextElement =
        marshaller.marshall(samlResponse);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String responseString =
        XMLHelper.nodeToString(plaintextElement);<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("SAML response: " + responseString);<br>
        <br>
        Can I do something similar to output the entire message?<br>
      </div>
    </blockquote>
    <br>
    <br>
    Yes, the message encoder and decoder impls already have this support
    built-in via special logging categories.&nbsp; Just turn on DEBUG level
    logging for Logger with name "PROTOCOL_MESSAGE" and you will get
    whatever is in the message context as the outbound or inbound
    message respectively.&nbsp; To get logging to the console or anywhere
    else you want, you just need to supply you desired logging impl of
    SLF4J (e.g logback or one of the slf4j-to-whatever adapters) and the
    appropriate configuration.<br>
    <br>
    &nbsp;<br>
    <br>
    <br>
  </div>

</div><br>--<br>To unsubscribe from this list send an email to <a ymailto="mailto:dev-unsubscribe@shibboleth.net" href="mailto:dev-unsubscribe@shibboleth.net">dev-unsubscribe@shibboleth.net</a><br><br> </div> </div>  </div></body></html>