0
votes

I use Axis 1.4 to generate java classes from http://10.0.0.22/_vti_bin/Lists.asmx

I use following code to access web service:

javax.xml.rpc.Service service = new ListsLocator();
ListsSoapStub stub = SharePointWSDL.newLists(new URL("http://10.0.0.22/_vti_bin/Lists.asmx"), service);
stub.setUsername(username);
stub.setPassword(password);
com.microsoft.schemas.sharepoint.soap.GetListCollectionResponseGetListCollectionResult lcr = stub.getListCollection();

I get "(401)Unauthorized" error.

How can I use java classes which are generated by Axis to access SharePoint web service?

2
Does the account you are using have access to the site? Also, why are you using IP address?Kit Menke
Account used have access to the site. SharePoint is installed on local machine, so I use local IP.Tran Dinh Thoai

2 Answers

1
votes

The problem is that Basic Authentication is not enabled on IIS. When I enable Basic Authentication, I can access SharePoint web serivce.

0
votes

If you have ListsSoap12Stub try this instead of ListsSoapStub. This worked for me.