[SOAP Extensibility Samples] Having trouble adding header

Forge Component
(4)
Published on 15 Feb by Pedro Guimarães
4 votes
Published on 15 Feb by Pedro Guimarães

I'm trying to use the 'AddSOAPHeader_ToRequest' function to add a header to my soap request.

However, I'm having a hard time understanding what I need to provide as input to the function to create a header.

With the following SOAP action, what do I fill in to add the authentication header in 'Name', 'Namespace' and 'Value', the input parameters for the function?


<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:com="https://api.company.nl/soap/Service">
   <soap:Header>
      <com:AuthHeader>
         <!--Optional:-->
         <com:Username>?</com:Username>
         <!--Optional:-->
         <com:Token>?</com:Token>
      </com:AuthHeader>
   </soap:Header>
   <soap:Body>
      <com:List_GetAll/>
   </soap:Body>
</soap:Envelope>

Hello,

I currently have the exact same issue. Regardless of what I put in the inputs I always get the error "Object reference not set to an instance of an object."

If anyone could help undestanding what are the correct values to the inputs, I would appreciate.