Reputation: 2291
I have created web service using c#. I consumed using c# client I got 401 Unauthorized error. So, I set the property UseDefaultCredentials = true.
Then I tried to access the web service using java client, I get again 401 Unauthorized error. I don't know how to use java client stubs. So, can someone point me in that direction.
I got these class files in Eclipse
DemoWebServ.java
DemoWebServLocator.java
DemoWebServSoap.java
DemoWebServSoapProxy.java
DemoWebServSoapStub.java
I need to access the web service by giving username and password by using above stubs
EDIT 1
on some googling i found that adding
_call.setProperty(org.apache.axis.client.Call.USERNAME_PROPERTY, "USERNAME");
_call.setProperty(org.apache.axis.client.Call.PASSWORD_PROPERTY, "PASSWORD");
will solve the issue but even after adding above statements in DemoWebServSoapStub.java. I have not been able to resolve the issue
Upvotes: 0
Views: 1376
Reputation: 2291
Figured out the solution,
This happened because of the anonymous access security for website in IIS. I used the account I have on the windows server to set anonymous access uname/password. Then I used the same combination in
_call.setProperty(org.apache.axis.client.Call.USERNAME_PROPERTY, "USERNAME");
_call.setProperty(org.apache.axis.client.Call.PASSWORD_PROPERTY, "PASSWORD");
It worked. I dont know how secure it is :(
Upvotes: 0