Skip to main content
Hi. 

I'm doing an integration with an external service (web service), I generated the apex classes through WSDL2Apex until here everything goes well, the problem is that the WS has a web service security header and I do not know how to add it. The header I have to add is the following:

   <soapenv:Header>

 <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" wsse:mustUnderstand="1">

     <wsse:UsernameToken>

         <wsse:Username>XXXXX</wsse:Username>

         <wsse:Password>XXXX</wsse:Password>

        </wsse:UsernameToken>

   </wsse:Security>

   </soapenv:Header>

If someone has done something similar and can help me would be greatly appreciated.

Thanks in advance for any help.
5 respuestas
  1. 27 nov 2018, 05:59
    Hi Christian,

    Sorry for this issue you are facing.

    Salesforce, unfortunately, does not support setting SOAP headers (like WS-Security) that are not explicitly included in the WSDL markup. You can set HTTP headers of course, but not SOAP headers.

    There may be a workaround though - you should be able to manually insert the Web Service Security headers into the SOAP payload. 

    Thanks,

    Nagendra
0/9000