We are trying to invoke a web service provided by a JAVA based application from a .NET based application.
This web service was already existed but recently authentication is made compulsory to invoke this service.
But we are facing following error saying authentication failed. Request does not reach the target application.
Connectivity is correctly established if target application disables the authentication. So rest of the code is fine.
Can anybody help is solving this issue please?
Following is the code that we are using to enable authentication with “Basic” 64bit encoding.
• .NET Framework 1.1
• IIS 6.0
• WINDOWS Server 2003
• Target URL is correct and is verified.
• User name and password is correctly configured.
objJAVAApplication.PreAuthenticate = true;
DOTNETApplicationDataAccessLayer.clsCommon objCmn = new DOTNETApplicationDataAccessLayer.clsCommon();
string urlSetting = objCmn.GetConfiguration("JAVAApplicationUrl");
if ((urlSetting != null))
MPAUrl = string.Concat(urlSetting, "");
MPAUrl = "URL of JAVA applicaton which we are trying to connect";
System.Net.CredentialCache myCredentials = new System.Net.CredentialCache();
NetworkCredential netCred = new NetworkCredential("UserName", "Password", "Domain");
myCredentials.Add(new Uri(JAVAApplicationUrl), "Basic", netCred);
objMPA.Credentials = myCredentials;