icon-arrow icon-check icon-mail icon-phone icon-facebook icon-linkedin icon-youtube icon-twitter icon-cheveron icon-download icon-instagram play close close icon-arrow-uturn icon-calendar icon-clock icon-search icon-chevron-process icon-skills icon-knowledge icon-kite icon-education icon-languages icon-tools icon-experience icon-coffee-cup
Werken bij Integration & Application Talents
Blog 02/01/2019

NTLM authentication with SOAP in Mule 4

SOAP

While connecting with system API’s, one is often confronted with some nice exotic protocols. While some protocols are not considered cool anymore (SOAP for example), some authentication schemes just gives you a headache. This blog post shows how to do that.

Whitehorses
Laurens van der Starre /
Integratie expert

While connecting with system API’s, one is often confronted with some nice exotic protocols. While some protocols are not considered cool anymore (SOAP for example), some authentication schemes just gives you a headache.

So when consuming a SOAP webservice in Mule 4 that is secured with Microsoft’s NTLM you just have to consider the following:

  • The Web Service connector won’t work. There is no NTLM authentication in there. That makes sense by the way: in the SOAP world we have the WSSecurity standards for that.
  • The DOMAIN name should always be in capitals (I want hours of my life back).
Web Service Consumer Connector instellingen
Web Service Consumer configuration

Instead of using the Web Service Consumer, use the HTTP Request connector (POST method). You can setup the NTLM configuration in the HTTP Request configuration:

HTTP Request Connector configuration

In my experience the DOMAIN should always be in all caps. It won’t work otherwise.

However, using the HTTP Request means that you should manually create the SOAP request message as XML payload. This is a bit cumbersome, but not that hard using DataWeave 2:

%dw 2.0
output text/xml
ns soapenv http://schemas.xmlsoap.org/soap/envelope/
ns wh ns.whitehorses.nl
---
{
 soapenv#Envelope: { 
   soapenv#Body: {
      wh#MyBodyElement: {
       <<ETC>>       
      }
    }
 }
}

 

Also, don’t forget the set the SOAPAction header as Header in the HTTP Request connector! This is often required by SOAP web services. (Or, when using Mule 3, set a SOAPAction property).

Happy coding!

Overzicht blogs

Geen reacties

Geef jouw mening

Reactie plaatsen

Reactie toevoegen

Jouw e-mailadres wordt niet openbaar gemaakt.

Geen HTML

  • Geen HTML toegestaan.
  • Regels en alinea's worden automatisch gesplitst.
  • Web- en e-mailadressen worden automatisch naar links omgezet.
Whitehorses
Laurens van der Starre /
Integratie expert

Wil je deel uitmaken van een groep gedreven en ambitieuze experts? Stuur ons jouw cv!