views:

57

answers:

2

I have a HTTPS Java Web Service, I am trying to access the web service with .NET[.NET 2.0 style client / WCF client]. I am getting back this error from WS.

"HTTP Status 401 - This request requires HTTP authentication ()."

How do I find out what kind of security this WS has? Besides SSL, I have user name and password to send it to WS, I believe this is part of message authentication.

Java client seems like successfully communicating, and it has few interesting lines,

        System.setProperty("javax.net.ssl.keyStorePassword", new String(jsseKeyStorePassword));
        System.setProperty("javax.net.ssl.trustStorePassword", new String(jsseTrustStorePassword));

----------------------------------------------

  BindingProvider bindingProvider = (BindingProvider) port;
        bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
        bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, new String(password));

I would appreciate any help.

A: 

It seems as though the Java WS requires a server and root certificate stored in a couple of key stores. It requires knowledge of the passwords to these key stores to obtain the certificates, which seem to be available in the jsseKeyStorePassword and jsseTrustStorePassword variables.

Also, you should be using at least .NET Framework 3.0 in order to use Windows Communication Foundation.

Bernard
FYI I am using .NET 4.0.
iraSenthil
That's good, but you did mention ".NET .20 / WCF".
Bernard
Mhm, I meant .NET 2.0 style client or WCF client
iraSenthil
A: 

Long story short, Two problems I had to solve,

  1. HTTP Status 401 - This request requires HTTP authentication ()

    Changed Authentication schema to Basic in the VS generated customeBinding in app.config

  2. HTTP/1.1 505 HTTP Version Not Supported

    Remove Expect: 100-continue SOAP header. Add this line ServicePointManager.Expect100Continue = false;. For the details of the issue, go here

Long story here http://www.irasenthil.com/2010/10/wcf-client-to-java-web-service.html

iraSenthil