cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
cherylshah
Nintex Newbie

Write XML for Call Web Service using Web method UpdateListItems

Jump to solution

Hello,

I am very new to XML and having trouble configuring a Call Web Service action. Can anyone tell me what is wrong with my XML code please?

 

My process is:

1. Site A: List A workflow creates a new item in Site B: List B (same site collection). As part of the Create Item action, the column RFTID in List B is set to the ID of the item in List A on which the workflow is running.

2. A workflow on List B is started upon creation of the new item in List B in which the Call Web Service is intended to update the item in Site A: List A, with the Title of the new item in Site B: List B.

 

I am getting this error from the Site B: List B workflow, on the Call Web Service action:

 

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap: Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

 

Here is the XML in my SOAP Editor:

 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/sharepoint/soap/">
  <soap:Header/>
  <soap:Body>
    <m:UpdateListItems>
      <m:listName>{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}</m:listName>
      <m:updates>
        <Method ID="1" Cmd="Update">
          <Field Name="ID">{ItemProperty:RFTID}</Field>
          <Field Name="NewCRNumber">{ItemProperty:Title}</Field>
        </Method>
      </m:updates>
    </m:UpdateListItems>
  </soap:Body>
</soap:Envelope>

 

Thank you in advance for any assistance!

Labels: (1)
0 Kudos
Reply
1 Reply
cherylshah
Nintex Newbie

Re: Write XML for Call Web Service using Web method UpdateListItems

Jump to solution

I've solved this myself - posting in case it helps anyone else.

 

Instead of using Call Web Service with the UpdateListItems method from the List B workflow, I added a Call Web Service with web method GetListItems to the List A workflow, after the Create Item In Another Site action.

 

In order to make the workflow wait until the List B workflow had set the field value I wanted, I created a variable called NewCRNumber in the List A workflow with a null default value. Then I enclosed the Call Web Service and Query XML actions in a Loop with the condition "Workflow Data NewCRNumber is empty".

 

Loop.jpg

 

 

In the Create Item in Another Site action, the ID of the new item must be stored in a variable of type List ID. I'm sure there's a better way to do this, but since my model code had <Value Type="Text"> I just created another variable called 'text CR ID', and set it equal to the List ID type variable 'CR ID' prior to the Loop action.

 

In the SOAP editor field of the Call Web Service action I have the following, based on the information in this post:

 

<?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:Header/>
  <soap:Body>
    <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx}</listName>
      <viewName></viewName>
      <query>
                      <Query>
                             <Where>
                                     <Eq>
                                      <FieldRef Name="ID" />
                                      <Value Type="Text">{WorkflowVariable:text CR ID}</Value>
                                      </Eq>
                            </Where>
                    </Query>
</query>
      <viewFields></viewFields>
      <rowLimit></rowLimit>
      <queryOptions xmlnsSmiley FrustratedOAPSDK9="http://schemas.microsoft.com/sharepoint/soap/">
 <QueryOptions/>
</queryOptions>
      <webID></webID>
    </GetListItems>
  </soap:Body>
</soap:Envelope>

 

The result of the Call Web Service action is saved in workflow variable GetListItem_Results, which is then the source for the Query XML action:

 

Query XML.jpg

I knew to use LinkTitleNoMenu from reading the output in an email sent to myself, as suggested in the link above. Now I had the value, in NewCRNumber, with which I wanted to update the original item in List A.

Tags (2)
0 Kudos
Reply