Ever always, whenever I come across this topic/question, I don’t have a very appropriate answer to it. So here I am summarizing my understanding of web services.
A Web service is a method of communication between two applications or electronic devices over the World Wide Web (WWW).
Two types to access web services: Simple Object Access Protocol (SOAP) and Representational State Transfer (REST).
My previous post was how can a Nintex workflow be published to multiple lists in the same site.
This time, it is a slight variation. The question this time is how can a workflow be published to multiple lists that reside on different sites.
Interesting stuff!! Trust me 🙂
Let me tell you how I came to this scenario
I have a site that is saved as a template, and close to 200+ sites have been created out of that template. All worked great until one day when I received this request for a change in one of my workflows in one of the lists of the site.
Also, this change had to be copied to almost 40 out of the 200 sites created.
Of course, I made the changes in the template site, but the challenge was how do I publish my updated workflow to the said sites.
This happened to be a slight extension to the same methodology that was used previously. Continue reading
Requirement – I have a site that has around 40 country lists which have the same workflow. When there is a change in the workflow, there is a need to update the workflow in all 40 lists; which is practically impossible. Also, it wouldn’t be considered a good practice.
As most of the times, I knew there was a solution using Nintex. And the moment I found it, I fell even more in love with this workflow tool. It keeps surprising me as always!
Solution – Nintex workflow comes with a web method called PublishFromNWFXML that will do this job for us.
Update your workflow at the parent location and export it. Upload the nwf file to a library (here – Shared Documents) and create the below workflow on this library, that will update it to the multiple lists.
I have already written about the 401 Unauthorized error earlier here. But I faced something else which I thought I should write to save someone else’s time.
Being the site collection administrator I didn’t expect this error, however when trying to access a web service from my site’s workflow I encountered it. Twice this has happened to me while moving my applications to the production server and I made it a point to write about it.
Background – My application has a Nintex workflow that uses the “Call Web Service” action. This action made a call to the copy.asmx web service. Worked all good until it was in my development and UAT machines. The moment I moved it to the live environment, it started throwing the 401 Unauthorized error. I ensured that the account accessing the web service has full control (also made it site collection administrator), still the error didn’t go.
“Failed to invoke Microsoft Exchange web service. Task item failed with response code ErrorFolderNotFound”
This is the error that you get when you connect to the Exchange Web Service.
To copy current item to a destination list/library, we have “Copy Item” action. To copy the InfoPath form or the embedded attachments for the current item, we have “Copy to SharePoint” action. But what when we need to copy documents from one library to another…
Well, to accomplish this, SharePoint exposes a web service called Copy.asmx that allows us to copy files from one location to another using the CopyIntoItemsLocal web method.
Requirement – For every item created in some list, create a new folder in a destination library B and copy documents/templates from source library A into that folder. Folder name being a unique property of the item (here ‘CRID’).
Solution – Create a workflow with below steps to copy documents/files Continue reading
Quite often, I have observed “401 – Unauthorized error” when I access any web service(GetRunningWorkflowTasksForCurrentUserForListItem, GetUserProfilebyName – I have tried with these 2 services) from my Info Path form.
You access a web service to get some detail and end up with a big xml variable with multiple nodes. How do you get the exact node’s value. Let’s figure out.
Step 1 – Call Web service
I call the web service Lists.asmx and use the web method GetList. Pass the listname (here Expenses2) as parameter and run the web service now.
Copy this xml and keep it saved, may be in a text file. (You’ll need it a couple of times)
userName() method of Info Path form returns the user id/ account id. To get other details such as display name, email id, manager, phone number, etc., we can use the web service “UserProfileService.asmx”
Lets say we want to get the display name, email and accound id for the currently logged in user.
Whenever an Info Path form published to a form library has to undergo approval using Nintex, the default approval form will have options to approve/reject and provide the comments. However, not all details of the form can be seen on the same page (until it is a list item’s approval page). Only the fields promoted from the Info Path form to the library can be seen in the approval page. So here’s the reason why I’m posting this article. In my case, the customer came back to me saying why can’t they have a single form that displays the details of the library item i.e. the Info Path form along with an option to approve / reject at the bottom of the same form. So, a bit of research helped here and here’s the solution.