popeye.sailor
popeye.sailor

Reputation: 1

Apache Camel - NTLM Configuration

I want to call NTLM authenticated service through apache camel. It fails with 401 status if I call direct without any Java DSL configuration as below, IS there a way to add NTLM authentication mode , user name and password when call the service?

from("direct:link.XXX.soap.out")                    
.setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http4.HttpMethods.POST))
.setHeader(Exchange.CONTENT_TYPE, constant("application/soap+xml"))
.log(LoggingLevel.WARN,"routes","SOAP message:\n${body}")
.to("http://projectname.csq.YYY.net/api/service")
.to("file:logs/XXX.out.soapreply");

Upvotes: 0

Views: 1732

Answers (1)

Petter Nordlander
Petter Nordlander

Reputation: 22279

Camel uses Apache HTTP client for the HTTP producer. NTLM should be supported out of the box by default.

However, this applies to version 4 of HTTP client. Version 3 has only limited NTLM support (reverse engineered). To use version 4 in Camel, do .to("http4://projectname.csq.YY.net/api/service") instead.

Upvotes: 1

Related Questions