Proactive authentication why

Why is pre-authentication required?

System.setProperty ("httpclient.authentication.preemptive", "true");

I wrote a client services program to access web services in Java. Where we set the username and password in the call object, and it worked fine.

Recently, our service provider made some changes on their side, after which they did not receive the username and password in the call to the web service, and because they did not receive the username and password, so we could not connect to their service (provider).

Then I did a googling search and discovered proactive authentication. When invoking web services, we set "httpclient.authentication.preemptive" to "true" - System.setProperty ("httpclient.authentication.preemptive", "true"); then we can receive answers from our service provider.

When we remove System.setProperty ("httpclient.authentication.preemptive", "true"); line, then we cannot connect to their services.

+4
source share
1 answer

When we changed the pivot = "java: org.apache.axis.transport.http.HTTPSender" transport to the pivot = "java: org.apache.axis.transport.http.CommonsHTTPSender" transport in the client-config.wsdd file. This problem was resolved without installing System.setProperty ("httpclient.authentication.preemptive", "true") ;.

client-config.wsdd -

<?xml version="1.0" encoding="UTF-8"?> <deployment name="commonsHTTPConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <!-- use CommonsHTTPSender instead of the default HTTPSender --> <transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" /> <transport name="local" pivot = "java:org.apache.axis.transport.local.LocalSender" /> <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender" /> </deployment> 
+1
source

All Articles