Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HttpPost httppost = new HttpPost(serviceUrl);
- StringEntity se;
- 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>"
- + "<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">"
- + "<listName>"
- + "{DF1398C7-EF73-485E-913E-5F5896D6DF22}"
- + "</listName>"
- + "<updates>"
- + "<Batch OnError='Continue' ListVersion='1'>"
- + "<Method ID='1' Cmd='New'>"
- + "<Field Name='Title'>View</Field>"
- + "<Field Name='Resource'>7;#A Kr Singh</Field>"
- + "<Field Name='Project'>13;#Microsoft- SharePoint based Employee Portal</Field>"
- + "<Field Name='Task'>1;#Accounting</Field>"
- + "<Field Name='Date'>2014-11-21 11:15:50</Field>"
- + "</Method>"
- + "</Batch>"
- + "</updates>"
- + "</UpdateListItems>"
- + "</soap:Body>" + "</soap:Envelope>";
- se = new StringEntity(String.format(str1, HTTP.UTF_8));
- se.setContentType("text/xml");
- httppost.setEntity(se);
- HttpResponse httpresponse = httpclient.execute(httppost);
- InputStream in = httpresponse.getEntity().getContent();
- String str = inputStreamToString(in).toString();
- readSoap(str);
- } catch (Exception e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement