title: wsse Security Header with SAML
body: <p>I need to consume the web service which is exposed by my service provider. I got the WSDL file from them. In SOAP request header I have to add the wsse:Security header with SAML assertion.</p>
  
  <p>Please have a look at the below wsse:Security header. I have searched a lot and tried with WSE 3.0, WIF and WCF. Help me to move further spent around 15 days and I'm running out of time.</p>
  
  <p>I don't need a code. If you give me clues it's more than enough.</p>
  
  <pre><code> &lt;wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
    &lt;wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-2205212A7CE172EDAD136396070929096"&gt;MIIGOzCCBSOgAwIBAgIRAMLHEnngSJwPhUBrQD7Wau&lt;/wsse:BinarySecurityToken&gt;
    &lt;saml2:Assertion ID="2205212A7CE172EDAD136396070923593" IssueInstant="2013-03-22T13:58:29.235Z" Version="2.0" xsi:type="saml2:AssertionType" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;saml2:Issuer&gt;Test.com&lt;/saml2:Issuer&gt;
      &lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;
        &lt;ds:SignedInfo&gt;
          &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
          &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/&gt;
          &lt;ds:Reference URI="#2205212A7CE172EDAD136396070923593"&gt;
            &lt;ds:Transforms&gt;
              &lt;ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/&gt;
              &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
            &lt;/ds:Transforms&gt;
            &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/&gt;
            &lt;ds:DigestValue&gt;NI1mY4izfZO9cTmY9RQ1wc=&lt;/ds:DigestValue&gt;
          &lt;/ds:Reference&gt;
        &lt;/ds:SignedInfo&gt;
        &lt;ds:SignatureValue&gt;PPiZmdZRnUNl5XLT&lt;/ds:SignatureValue&gt;
        &lt;ds:KeyInfo&gt;
          &lt;ds:X509Data&gt;
            &lt;ds:X509Certificate&gt;
              MIIGOzCCBSOgAwIBAgIRAMLHEnngSJwPhUBrQD7Wa
              uEwDQYJKoZIhvcNAQEFBQAwgYkxCzAJBgNV
              BAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAY            
              r7A/P/13q1BRTPvLM6CYNzb4wvAgBxiuBV97OoVSnMPxYVtW03OoOCquyXDrq8bLYuR5+l1YGahY
              D5nJfSXiCb9PCf5m+hZh6smWp1rMcafMLdr5+JbZEPPk36S1q1aokpoeEo2N0Hmg9mt2GOg6Z+Qu
              ya9s
            &lt;/ds:X509Certificate&gt;
          &lt;/ds:X509Data&gt;
        &lt;/ds:KeyInfo&gt;
      &lt;/ds:Signature&gt;
      &lt;saml2:Subject&gt;
        &lt;saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="Qualifier"&gt;CN=Test.com,OU=PlatinumSSL,OU=Test Company,OU=Test,O=Test&lt;/saml2:NameID&gt;
        &lt;saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:sender-vouches"/&gt;
      &lt;/saml2:Subject&gt;
      &lt;saml2:Conditions NotBefore="2013-03-22T13:58:29.235Z" NotOnOrAfter="2013-03-22T14:03:29.235Z"/&gt;
      &lt;saml2:AuthnStatement&gt;
        &lt;saml2:AuthnContext&gt;
          &lt;saml2:AuthnContextClassRef&gt;urn:oasis:names:tc:SAML:2.0:ac:classes:Password&lt;/saml2:AuthnContextClassRef&gt;
        &lt;/saml2:AuthnContext&gt;
      &lt;/saml2:AuthnStatement&gt;
    &lt;/saml2:Assertion&gt;
    &lt;wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0" wsu:Id="STRSAMLId-2205212A7CE172EDAD136396070929097" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"&gt;
      &lt;wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLID"&gt;2205212A7CE172EDAD136396070923593&lt;/wsse:KeyIdentifier&gt;
    &lt;/wsse:SecurityTokenReference&gt;
    &lt;ds:Signature Id="SIG-19" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;
      &lt;ds:SignedInfo&gt;
        &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
          &lt;ec:InclusiveNamespaces PrefixList="head pros soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
        &lt;/ds:CanonicalizationMethod&gt;
        &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/&gt;
        &lt;ds:Reference URI="#id-1"&gt;
          &lt;ds:Transforms&gt;
            &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
              &lt;ec:InclusiveNamespaces PrefixList="head pros" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
            &lt;/ds:Transform&gt;
          &lt;/ds:Transforms&gt;
          &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/&gt;
          &lt;ds:DigestValue&gt;yBGE2mVOFnzQPTA9v/7yIvq0CIk=&lt;/ds:DigestValue&gt;
        &lt;/ds:Reference&gt;
        &lt;ds:Reference URI="#STRSAMLId-2205212A7CE172EDAD136396070929097"&gt;
          &lt;ds:Transforms&gt;
            &lt;ds:Transform Algorithm="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform"&gt;
              &lt;wsse:TransformationParameters&gt;
                &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
              &lt;/wsse:TransformationParameters&gt;
            &lt;/ds:Transform&gt;
          &lt;/ds:Transforms&gt;
          &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/&gt;
          &lt;ds:DigestValue&gt;/2QpTYDtLM4GnZIVq5/RihtL6Ug=&lt;/ds:DigestValue&gt;
        &lt;/ds:Reference&gt;
      &lt;/ds:SignedInfo&gt;
      &lt;ds:SignatureValue&gt;
        Yx4SB76RTGcrll18wYlwvLAWHgNeckPcO9be1opcAL99dzDe5RspWkmLjXJ0rY7wh+RPW+wzaJyI
        r0ezOByRNCFWHFNjZOdN5wj++h7pnJRFLe70WGNktREOckaQ/U/O5NLH8adkWFm+Q/wZApw2WLI6
        6uWmQ+l8rOaWPg8gsBS8sjn1S55W2MYPtnwSew==
      &lt;/ds:SignatureValue&gt;
      &lt;ds:KeyInfo Id="KeyId-2205212A7CE172EDAD136396070929094"&gt;
        &lt;wsse:SecurityTokenReference wsu:Id="STRId-2205212A7CE172EDAD136396070929095"&gt;
          &lt;wsse:Reference URI="#CertId-2205212A7CE172EDAD136396070929096" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/&gt;
        &lt;/wsse:SecurityTokenReference&gt;
      &lt;/ds:KeyInfo&gt;
    &lt;/ds:Signature&gt;
  &lt;/wsse:Security&gt;
  </code></pre>
  
  <p>Thanks and regards,
  P.Ponkarthik</p>