360
Views
7
Comments
[SOAP Extensibility] Having trouble adding header
Question
soap-extensibility-samples
Service icon
Forge asset by OutSystems

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="https://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>

2020-03-25 15-00-48
Ana Sofia Moreira

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.


UserImage.jpg
Prasad Rao

Hi,

you need to call RegisterInspectHeaders as first thing in OnBeforeRequestAdvanced and then "Object reference not set to an instance of an object." error would dissapear.




UserImage.jpg
Shirish Bathe

@rob knipscheer: Did you got a solution to this problem.  Even I have the same requirement to add user credentials as a part of SOAP Header.  I am getting "Unable to extract the User from the SOAP Header"

---- SOAP Header ---

<SOAP-ENV:Header xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"

                   xmlns:S="https://schemas.xmlsoap.org/soap/envelope/"

                   xmlns:env="https://schemas.xmlsoap.org/soap/envelope/">      

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

         <wsse:UsernameToken>

            <wsse:Username>myuset@dummy.com</wsse:Username>

            <wsse\:Password>nYRU1FoZ</wsse\:Password>

         </wsse\:UsernameToken>

      </wsse\:Security>

   </SOAP-ENV\:Header>

I have used "AddSOAPHeader_ToRequest" with following parameters:

1. Name:  "Security"

2. Namespace: "https://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"

3. Value: "

         <wsse:UsernameToken>

            <wsse:Username>myuset@dummy.com</wsse:Username>

            <wsse\:Password>nYRU1FoZ</wsse\:Password>

         </wsse\:UsernameToken>

"

----

I have attahced Sample.oml for reference.

Let me know If I am missing anything.

Sample.oml
UserImage.jpg
Prasad Rao

Hi,

There is other plugin which is specifically built to add the wise:security header to SOAP request. I would recommend trying that, this extension mostly provides basic stuff and just a starting point to extend further.

Thanks,

Prasad Rao

UserImage.jpg
Shirish Bathe

@Prasad: thanks for a swift response.  Can you please provide little more details or link to the plugin which you are referring to.

2023-12-28 16-01-00
Sérgio Trindade

you were able to fill the soap header?

I'm having issues in what I should add in the name,namespace and value parameters of the AddSOAPHeader_ToRequest action.

Thanks

UserImage.jpg
Prasad Rao

Hi,

WCF WS-Security and WSE Nonce Authentication (https://www.outsystems.com/forge/component-overview/6374/wcf-ws-security-and-wse-nonce-authentication) worked for us

Thanks,

Prasad

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.