You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Arindam Mukherjee <am...@projectp.com> on 2011/07/20 01:23:24 UTC

Accessing Sharepoint 2010 custom webservices using Axis2

   All,

 Has anybody used axis2 framework to access sharepoint 2010 webservices?  I
have used axis2 framework to access sharepoint 2007 webservices. But, same
code throws "Error: 401: Unauthorized" in sharepoint 2010. I have used
following axis2 code:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
   auth.setUsername(username);
   auth.setPassword(password);
   auth.setDomain(domain);
   auth.setHost(host);

   List authPrefs = new ArrayList(1);
    authPrefs.add(AuthPolicy.NTLM);
   auth.setAuthSchemes(authPrefs);
   String targetPoint = "http://"+host+"/_layouts/PPUpload.asmx";

   UploadStub lists = new UploadStub(targetPoint);

lists._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
auth);

   com.projectp.sharetest.UploadStub.UploadDocument doc = new
com.projectp.sharetest.UploadStub.UploadDocument();
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Am I missing something?

Thanks,
Arindam