StringEntity entity = new StringEntity("<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><Login xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"><username>"myusername"</username><password>"mypassword"</password></Login></soap:Body></soap:Envelope>");
entity.setContentEncoding("utf-8");
post1.setEntity(entity);
System.out.println("calling service");
String response = client.execute(post, handler);
System.out.println("response is "+response);
Я получаю ответ XML как:Доступ к Sharepoint WebServices с помощью Java
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<LoginResult>
<ErrorCode>PasswordNotMatch</ErrorCode>
<TimeoutSeconds>0</TimeoutSeconds>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>
пожалуйста кто-нибудь сказать мне, где я geetting неправильно? Спасибо заранее!
вы отсутствующего любые требования безопасности? Я имею в виду, что ваш веб-сервис принимает пароль в текстовом или хэшированном виде? – waqaslam
вы можете рассказать, как отправить его в хэшированном формате? –