1

I am connecting using webservices from a Java client on Windows to a Sharepoint 2007 server in the same domain. The communication is using https.

So far, I checked that by running the client from my account my credentials were used and did not worry more, but now I want to set independent credentials so changes in the items are not logged as "mine", so I put the data in the requestContext:

Lists listas =
  new Lists(
    new URL(
      urlBase
        + UtilsSp.LISTS_WSDL_PATH),
      new QName(
        "http://schemas.microsoft.com/sharepoint/soap/",
        "Lists"));
ListsSoap listasSoap = listas.getListsSoap();
BindingProvider bp = (BindingProvider) listasSoap;
bp.
  getRequestContext().
  put(
    BindingProvider.USERNAME_PROPERTY,
    "MyUser";
  bp.
    getRequestContext().
    put(
      BindingProvider.PASSWORD_PROPERTY,
      "MyPassword");
  bp.
    getRequestContext().
    put(
      BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
      "https://mySharepoint.mydomain.com/mySite");

But, anyway, I have no errors connecting to the site but the site keeps reporting that I am connecting using my domain username, not the one I pass it through the requestContext. What I am missing?

SJuan76
  • 24,532
  • 6
  • 47
  • 87
  • Did you solve this issue? – balbusm May 11 '16 at 12:52
  • @MateuszBalbus Unfortunately not, I have settled with launching the Java client (which is inside a JBoss) as a windows service running with the credentials needed by the server. Most of what I have seen uses `org.apache.commons.httpclient` or JCIFS, but that offers no way to authenticate through the WSDL generated client; maybe it could be made to work with a proxy, though. – SJuan76 May 11 '16 at 13:22
  • See below thread for solution: http://stackoverflow.com/questions/6184881/can-javas-single-sign-on-use-credentials-from-credential-manager-on-windo – balbusm May 11 '16 at 14:29

0 Answers0