Sharepoint Webservice Authentication Issue

Hi ,

This is to let you know that I tried to write a Java Agent to consume a SharePoint Webservice . The webservice is a secured web service . But I am not sure if the authentication is getting passed properly . I have tried accessing the Web Service from SOAPUi Client 4.5.1 NB SNAPSHOT and it works fine with my UserName and Password .

Below is the code that I have : -

mport lotus.domino.*;

import com.microsoft.webservices.SharePointPortalServer.UserProfileService.*;

public class JavaAgent extends AgentBase {

public void NotesMain() {

String HTTPuserName=“NA\UserName”;

String HTTPpassword=“Password”;

System.out.println(“Agent Starting”);

ArrayOfPropertyData aP = new ArrayOfPropertyData();

String PD=new String();

UserProfileServiceLocator NAIP_service= new UserProfileServiceLocator();

try {

UserProfileServiceSoap NAIP_RMTReq=NAIP_service.getUserProfileServiceSoap();

System.out.println(“Agent Stage 1”);

System.out.println(HTTPuserName);

System.out.println(HTTPpassword);

//System.out.println(NAIP_RMTReq.getEndpoint());

NAIP_RMTReq.setCredentials(HTTPuserName,HTTPpassword);

System.out.println(“Line71 :” + NAIP_RMTReq.getEndpoint());

aP=NAIP_RMTReq.getUserProfileByName(“NA\P0001”);//Pass the user’s account name as a parameter

System.out.println(NAIP_RMTReq.getEndpoint());

PD = aP.getPropertyData().toString();

System.out.println(PD);

//Prompt the PD value and see what it is returning

} catch(Exception e) {

e.printStackTrace();

}

}

}

Error that I am getting : -

WebServiceEngineFault

faultCode: {http://www.lotus.com/domino/ws/}HTTP

faultSubcode:

faultString: (401) Unauthorized

faultActor:

faultNode:

faultDetail:

{}string:

(401) Unauthorized

at lotus.domino.axis.transport.http.HTTPSender.readFromSocket(Unknown Source)

at lotus.domino.axis.transport.http.HTTPSender.invoke(Unknown Source)

at lotus.domino.axis.strategies.InvocationStrategy.visit(Unknown Source)

at lotus.domino.axis.SimpleChain.doVisiting(Unknown Source)

at lotus.domino.axis.SimpleChain.invoke(Unknown Source)

at lotus.domino.axis.client.AxisClient.invoke(Unknown Source)

at lotus.domino.axis.client.Call.invokeEngine(Unknown Source)

at lotus.domino.axis.client.Call.invoke(Unknown Source)

at lotus.domino.axis.client.Call.invoke(Unknown Source)

at lotus.domino.axis.client.Call.invoke(Unknown Source)

at lotus.domino.axis.client.Call.invoke(Unknown Source)

at lotus.domino.websvc.client.Call.invoke(Unknown Source)

at com.microsoft.webservices.SharePointPortalServer.UserProfileService.UserProfileServiceSoapStub.getUserProfileByName(UserProfileServiceSoapStub.java:23)

at JavaAgent.NotesMain(JavaAgent.java:30)

at lotus.domino.AgentBase.runNotes(Unknown Source)

at lotus.domino.NotesThread.run(Unknown Source)

I am getting the error on the following line in my Java Agent : -

aP=NAIP_RMTReq.getUserProfileByName(“NA\P0001”);

Please provide me with your help in passing the authentication to my WSDL in the appropriate way . Link to my WSDL is : -

http://servername/_vti_bin/UserProfileService.asmx?WSDL