• kevin garcia 10
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
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.
Hi,
My webservice expect a ws security header to be added in the request SOAP XML send to external system. I am able to make a call through SOAP UI but not able to figure out how to write a class to perform same functionality. Below is my sample xml

<soapenv:Envelope xmlns:onv="https://www.xyz.com/services/ONVInterface.wsdl" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <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">
         <wsse:UsernameToken>
            <wsse:Username>UserName</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Password</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <onv:ServiceRequestInput>
         <correlationID>12345</correlationID>
         <data><![CDATA[<SiebelMessage></SiebelMessage>]]></data>
      </onv:ServiceRequestInput>
   </soapenv:Body>
</soapenv:Envelope>


Kindly help me out. Thanks!