Forum Discussion

nareshk2k's avatar
nareshk2k
New Contributor
12 years ago

How to post the Attachment with Request body

Hi Team,
I am trying to Post one Attachment using SOAP UI. but I am notable to post it. initially I used POSTMAN for posting Attachments.

Here is the process i have followed:
Create Project
Create Test Suite
In Test Case add Data source
Select Media Type as multipart/form-data
select Post query string check box
Add attachment in Attachment section
Enter Request body and assign the values from data source
Add Headers (APIKEY/Accept-Language/Content-Disposition)
Run the test case

After Run the Test Case getting Below Error Message:

<Fault xmlns="http://127.0.0.1/api/Attachment/PostAttachment">
<ExceptionMessage>Did not find required 'Content-Disposition' header field in MIME multipart body part..</ExceptionMessage>
<ExceptionType>System.InvalidOperationException</ExceptionType>
<Message>An error has occurred.</Message>
<StackTrace>at Sage.FA.DaaS.Business.InMemoryMultipartFormDataStreamProvider.GetStream(HttpContent parent, HttpContentHeaders headers) in d:\Phase2-Sprint8\sfa-daas\daas\Projects\Sage.FA.DaaS.Business.Core\InMemoryMultipartFormDataStreamProvider.cs:line 52
at System.Net.Http.MimeBodyPart.GetOutputStream(HttpContent parent)</StackTrace>
</Fault>


So please provide the solution and the correct way to Post Attachments.