3
Answers

C# client cannot connect to Java Web Service

Mac

Mac

17y
10.5k
1
I have a C# .NET client (2.0 Framework) that needs to connect to a java web service (built with Axis) and send some data for processing. The java web service is hosted on a secured Apache server ( I am not in control of this server or web service).

I can create a web reference using VS2005 with the https URL of the WSDL file. When I try sending the data I receive the below error:

"Unable to connect to the remote server"

I added the below function to allow all server certificates.

public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}

I then make the below call before sending my values to the web service.

ServicePointManager.ServerCertificateValidationCal lback = new RemoteCertificateValidationCallback(ValidateServer Certificate);

I'm not sure if I missed something else or if the problem is not on my end at all.

Any help will be greatly appreciated.
Answers (3)