Call a Web Service Action
Call a Web Service from a SharePoint Designer 2010 Workflow.
1. Add “Call a Web Service” Action to a SharePoint Designer 2010 Workflow
2. Configure the Action
URL: The URL of the Web Service
SOAP Version: The SOAP Version of the request (1.1. or 1.2)
Action: The SOAP Action for the request
SOAP Request Envelope: The SOAP Envelope for the request (http://schemas.xmlsoap.org/soap/envelope/). The request will be UTF8 encoded.
You can use two special tokens in the request that can not be inserted via the UI:
[WebUrl] and [WorkflowInstanceId].
User: The user name for requests that needs authentication e.g. “Contoso\Administrator”. Instead of using user name and password you can use Secure Store Credentials.
Password: The password for the user. Unfortunately there isn’t a masked text box :-( You could either specify the password in clear text or encrypted like described here:
Encrypt Passwords for SharePoint Designer Workflow Actions
AppId: The The Secure Store Application ID. The Secure Store App have to define 2 Fields. One of type “User Name” and one of type “Password”. The Field Name doesn’t matter, important is the Field Type! You have to map the credentials of
the SharePoint Service Accounts (AppPool/owstimer.exe). The secure store option will only works with SharePoint Server not with Foundation!
Create a new List with the SharePoint Lists.asmx Web Service.
Configuration of “Call Web Service”
- URL: http://[siteurl]/_vti_bin/Lists.asmx
- SOAP Version: SOAP 1.2
- SOAPAction: not needed for SOAP 1.2
- Response: The response will be stored in the variable “Response”
- User: empty
- Password: empty
- Secure Store AppId: Instead of using user name and password we use the secure store app with the ID test. The app defines “User Name” and Password. The format of the user name for windows user should be “Domain\username”.
- SOAP Request Envelope:
1: <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
3: <AddList xmlns="http://schemas.microsoft.com/sharepoint/soap/">
5: <description>Created by iLSP action</description>
For the title of the list we use the title of the current list item that runs the workflow.
Now we extract the ID of the new list.
Configuration of “Query XML”
XML: The XML of the SOAP-Reponse that has been stored in the Variabe “Response”
XPath: //*[local-name()='List']/@ID Output: The output (List Id) will be stored in the Variable “ListID”
Write the “ListID” to the history log