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

My Call web service XML is not working with GetListItems method

Jump to solution

Hi Folks,

 

I have a workflow with a Call web service action and I am having trouble getting the XML to work. I need to use a Call web service so I can embed my generic service account (GSA) credentials in the action via workflow constants.

My configuration looks like this...

2020-01-14_17-01-30.png2020-01-14_17-03-50.png

 

My XML is as such...

<?xml version="1.0" encoding="utf-8"?>
<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">
<soap12:Body>
<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <listName>{CDF13E34-D116-4123-A9F9-858CD4E518A7}</listName>
<viewName>{9B4011F3-C18C-45D2-BCCF-542DC5060C00}</viewName> <query> <Where> <Eq> <FieldRef Name='UserID' /> <Value Type='Text'>{WorkflowVariable:var_CreatedByUserID_TXT}</Value>   </Eq> </Where> </query>
<viewFields>"ID"</viewFields> </GetListItems> </soap12:Body> </soap12:Envelope>

I have tried several variations and have removed empty references like <m:rowLimit></m:rowLimit>, <m:queryOptions>, and <m:webID></m:webID>.

 

Any assistance propperly forming this XML would be greatly appreciated.

 

Thanks and Regards,

Patrick Kelligan

Labels: (1)
0 Kudos
Reply
6 Replies
kelliganp
Nintex Newbie

Re: My Call web service XML is not working with GetListItems method

Jump to solution
Oh... and the error I am currently getting is...
Failed to invoke web service. Error returned from server: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XML

This is failing even when I have "Encode inserted tokens" checked also.
0 Kudos
Reply
Nintex Employee
Nintex Employee

Re: My Call web service XML is not working with GetListItems method

Jump to solution
Have you been able to get any web services working?
0 Kudos
Reply
kelliganp
Nintex Newbie

Re: My Call web service XML is not working with GetListItems method

Jump to solution

Thanks for responding @SimonMuntz. Surprisingly, yes as I find them a little mystifying. I was tinkering around with the tutorial here when researching how to use these and got the web service part of this one working well. I have not gotten to the report formatted email part yet but I was able to prove that I can use a web service. Also, I am a site collection admin. Did you see anything amiss?

Here is the error in preview (connection test was OK).

2020-01-15_8-38-59.png

 

Thansk and Regards,

Patrick

0 Kudos
Reply
kelliganp
Nintex Newbie

Re: My Call web service XML is not working with GetListItems method

Jump to solution

UPDATE...

Hi @SimonMuntz,

With the help of a colleague, @omalleyrp, we have it connecting with output. It still does not do what I need but here is what we did.

...The URL needed to be literal and not referenced as the target list was on another site in the site collection.

...Also, I wanted to return only the ID field value from the target list item. I used the <viewFields></viewFields> tag and put ID, "ID", and 'ID' between, each with the 500 error as a result. 

 

Here is my current working XML...

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
         <listName>tbl_Westerners</listName>
         <viewName />
         <query>
            <Query>
               <Where>
                  <Eq>
                     <FieldRef Name="UserID" />
                     <Value Type="Text">{WorkflowVariable:var_CreatedByUserID_TXT}</Value>
                  </Eq>
               </Where>
            </Query>
         </query>
         <viewFields></viewFields>
         <rowLimit />
         <queryOptions xmlnsSmiley FrustratedOAPSDK9="http://schemas.microsoft.com/sharepoint/soap/">
            <QueryOptions />
         </queryOptions>
         <webID />
      </GetListItems>
   </soap:Body>
</soap:Envelope>

Here is the output from my preview test...

<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>
    <GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <GetListItemsResult>
        <listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
          <rs:data ItemCount="0"></rs:data>
        </listitems>
      </GetListItemsResult>
    </GetListItemsResponse>
  </soap:Body>
</soap:Envelope>

...and here is the output from run against an item that I authored (some redaction used)...

<?xml version="1.0" encoding="UTF-8"?>
<listitems xmlns="http://schemas.microsoft.com/sharepoint/soap/" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:z="#RowsetSchema">
   <rs:data ItemCount="1">
      <z:row
		ows_ID="34" 
		ows_Field1="34.0000000000000" 
		ows_EmpID="*****" o
		ws_FirstName="*****" 
		ows_LastName="*****" 
		ows_MiddleInitial="*" 
		ows_FullName="*****, *****" 
		ows_LeidosEmail="*****.*.*****@*****.com" 
		ows_AKOEmail="*****.*.*****.***@***.mil" 
		ows_UserID="*****" 
		ows_EmpIsSupervisor="1" 
		ows_Gender="Male" 
		ows_StartDate="2010-08-30 00:00:00" 
		ows_FPCard="1" 
		ows_HomeOfRecord="*****, NC" 
		ows_KuwaitDL="0" 
		ows_HeavyDL="0" 
		ows_PickupDL="0" 
		ows_IssuedPhone="0" 
		ows_CellNumber="***-***-****" 
		ows_IssuedLaptop="0" 
		ows_Active="1" 
		ows_Status="PDY" 
		ows_Clearance="2.00000000000000" 
		ows_Org="1.00000000000000" 
		ows_Position="18.0000000000000" 
		ows_Section="6.00000000000000" 
		ows_Supervisor="81.0000000000000" 
		ows_CAC_YesNo="0" 
		ows_LinkToWAD="https://*****.*****.com/ASP/_layouts/FormServer.aspx?XmlLocation=/ASP/WorkAuthDoc/WAD_*****_*****-*****_*****_26June2016.xml&amp;OpenIn=browser" 
		ows_NewFlag="1.00000000000000" 
		ows_ContractName="ASP" 
		ows_PhysicalLocation="*****, NC" 
		ows_ContractExpDate="2020-02-29 00:00:00" 
		ows_TimeBank="1" 
		ows_LastPaidAirfare="2014-06-02 00:00:00" 
		ows_SharePointEditor="*****, ***** *." 
		ows_SharePointAuthor="*****, *****" 
		ows_SharePointModifiedDate="2015-11-19 23:25:00" 
		ows_SharePointCreatedDate="2014-04-03 17:56:00" 
		ows__Level="1" 
		ows_MetaInfo="34;#" 
		ows_owshiddenversion="149" 
		ows_Created="2015-11-23 22:11:35" 
		ows_PermMask="0x7fffffffffffffff" 
		ows_FileRef="34;#ASP/PMO/AdminWebDB/Lists/tbl_Westerners/34_.000" 
		ows__ModerationStatus="0" 
		ows_UniqueId="34;#{677AB0AA-30E5-4454-85C8-7274C3A3C326}" 
		ows_FSObjType="34;#0" 
		ows_Created_x0020_Date="34;#2015-11-23 22:11:35" 
		ows_Modified="2019-12-19 19:38:59" 
		ows_FileLeafRef="34;#34_.000" />
   </rs:data>
</listitems>

What I ultimatly need to return is the 34 (in this example) that shows up in ows_ID="34".

 

Am I misunderstanding the use of the <viewFields></viewFields> tag? If so, what is the correct/best sterategy to parse my needed value out of the output XML?

 

Thanks and Regards,

Patrick

0 Kudos
Reply
kelliganp
Nintex Newbie

Re: My Call web service XML is not working with GetListItems method

Jump to solution

With the help of @TomaszPoszytek in the post Query XML Error: Invalid Token I was able to bring this Call Web Service to a successful conclusion! Thanks to Tomasz and @omalleyrp for helping me get this done. Could not have done it without you both! Bob... If you past something here I will award the solution to you as Tomasz has the award in the othert post. Thanks again!

0 Kudos
Reply
omalleyrp
Nintex Newbie

Re: My Call web service XML is not working with GetListItems method

Jump to solution

Great news, glad it worked out for you!

View solution in original post

Reply