Reputation: 11577
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.
Upvotes: 3
Views: 4028
Reputation: 11577
Long story short, Two problems I had to solve,
HTTP Status 401 - This request requires HTTP authentication ()
Changed Authentication schema to Basic in the VS generated customeBinding in app.config
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
Upvotes: 2
Reputation: 7961
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.
Upvotes: 0