cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

AddAttachment web service not working

Jump to solution

I am Trying to use the Nintex Call web service workflow actions AddAttachment web method to attach a library contained document (where the workflow is running, to a form/document in a list. The library containing the document is hidden from users but the list documents are visible. Once the document is attached, it will be deleted from the library. The code is:

<?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:Header>
  <soap:Body>
    <m:AddAttachment>
      <m:listName>HR Nominations</m:listName>
      <m:listItemID>{ItemProperty:ID}</m:listItemID>
      <m:fileName>{ItemProperty:FileLeafRef}</m:fileName>
      <m:attachment>[FileData]</m:attachment>
    </m:AddAttachment>
  </soap:Body>
</soap:Envelope>

where "HR Nominations" is the name of the list containing the Nintex form/document resides and "ItemProperty:ID is the ID of the document to be attached. This looks correct, but throws the following error:

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

Any ideas or suggestions? There could be one or more documents, of various formats, to be attached.

The application is one where employees are nominated for various awards on a public site where the nomination form is available, and nominations bight be supported by attached documents. The nomination form, when saved, starts another workflow via a "Call web service" action. This workflow copies the form information to the private HR site for further action. The attachments are copied to a hidden library on the private HR site. The original, public record is then deleted. Personnel in HR receive an email message letting them know that a nomination has been submitted. (Once the supporting document(s) have been attached to the nomination, it/they are deleted from the hidden library.

Thanks for your help!

Bill

0 Kudos
Reply
6 Replies
Workflow Hero

Re: AddAttachment web service not working

Jump to solution

I believe that m:listItemID is the string that contains the ID of the item to which attachments are added. I don't think you have that by using the itemproperty:ID. This would need to be the destination list item to attach the document to.

Also, a good walkthrough that takes task attachments and copies to list items as attachments.

Reply
Workflow Hero

Re: AddAttachment web service not working

Jump to solution

Thank you Andrew. My problem is having the “ItemID” available in the hidden library where the attachment(s) is/are located. The “ItemID” is available with the original form when the copy is created in the private list. (The private list and hidden library are on the same site.) I am not sure how to copy the “ItemID” from the public list to the hidden library on the private site so I can then use it to reattach the documents to the form.

Bill

Applications

0 Kudos
Reply
Workflow Hero

Re: AddAttachment web service not working

Jump to solution

It may depend on how you are creating the item, what action(s) are you using?

0 Kudos
Reply
Workflow Hero

Re: AddAttachment web service not working

Jump to solution

Oh, and could the two lists be identical between the Public site and HR site? Both be lists with forms and allow document attachments. Then using the copy action, you should get the attachment. I'm not sure though if the library is required for your processes.

Then HR will get a notification to review, then once they complete the review you can then delete the attachment and not the list item to complete the process.

0 Kudos
Reply
Workflow Hero

Re: AddAttachment web service not working

Jump to solution

Thanks for your response Andrew. Let me look this over and get back to you sometime tomorrow if I possibly can. Again, thanks for your suggestions and I will provide additional info as well.

Bill

Applications

0 Kudos
Reply
Workflow Hero

Re: AddAttachment web service not working

Jump to solution

Andrew,

Sorry about the delay in getting back to you. After reviewing your suggestions and the workflows that we have been working on, it turns out that the problem was caused by the query in the second workflow. The filtering used was incorrect, and once that was resolved, all worked fine. I want to thank you for your help and patience in working with me on this.

Bill

Applications

0 Kudos
Reply