Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. HttpPost httppost = new HttpPost(serviceUrl);
  2. StringEntity se;
  3. String str1 ="<?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>"
  4. + "<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">"
  5. + "<listName>"
  6. + "{DF1398C7-EF73-485E-913E-5F5896D6DF22}"
  7. + "</listName>"
  8. + "<updates>"
  9. + "<Batch OnError='Continue' ListVersion='1'>"
  10. + "<Method ID='1' Cmd='New'>"
  11. + "<Field Name='Title'>View</Field>"
  12. + "<Field Name='Resource'>7;#A Kr Singh</Field>"
  13. + "<Field Name='Project'>13;#Microsoft- SharePoint based Employee Portal</Field>"
  14. + "<Field Name='Task'>1;#Accounting</Field>"
  15. + "<Field Name='Date'>2014-11-21 11:15:50</Field>"
  16. + "</Method>"
  17. + "</Batch>"
  18. + "</updates>"
  19. + "</UpdateListItems>"
  20. + "</soap:Body>" + "</soap:Envelope>";
  21. se = new StringEntity(String.format(str1, HTTP.UTF_8));
  22.  
  23. se.setContentType("text/xml");
  24. httppost.setEntity(se);
  25.  
  26. HttpResponse httpresponse = httpclient.execute(httppost);
  27. InputStream in = httpresponse.getEntity().getContent();
  28. String str = inputStreamToString(in).toString();
  29.  
  30. readSoap(str);
  31.  
  32. } catch (Exception e) {
  33.  
  34. e.printStackTrace();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement