You can turn the property '#log_level.httpclient.wire=debug' on so you can see what is being put out onto the wire byte by byte. This will tell you if it's picking up the document and spitting it out onto the wire.
If it is, then there might be an encoding issue (charset property in the Content-type header). Your server returns utf-8, but jmeter defaults to iso-8859-1 (which i'm not sure the exact differences are, but could behave strangely in converting docx files). Alternatively, you could try to read the file yourself through a JSR223 pre-processor and pass a variable to the http sampler that does the work. Just read the file line by line and build a string to pass to the http sampler through vars.put(). > Date: Fri, 4 Apr 2014 00:28:57 -0700 > From: [email protected] > To: [email protected] > Subject: Re: passing byte stream to upload document in HTTP sampler (Rest API) > > Hi > > Thanks for the reply, here my request is PUT not post. > I need to send bytestream of the document I want to upload > Below is the request and response > PUT > https://spint.dev.syncplicity.com/SyncplicityConnector/SPConnector.svc/namespace/Site1_DocLib2/JMFolder1/133KBDOCFile.docx > > PUT data: > > D:\Syncplicity\Automaiton\Trials\UploadDocs\133KBDOCFile.docx > > [no cookies] > > Request Headers: > Connection: keep-alive > x-isi-ifs-target-type: object > x-isi-ifs-site-url: http://SPOINT-3:8002/Site_Title_1 > Content-Type: > application/vnd.openxmlformats-officedocument.wordprocessingml.document > Content-Length: 63 > Host: spint.dev.syncplicity.com > User-Agent: Apache-HttpClient/4.2.6 (java 1.5) > > Response > Response headers: > HTTP/1.1 200 OK > Cache-Control: private > Content-Type: application/json; charset=utf-8 > Server: Microsoft-IIS/7.5 > x-isi-ifs-sharepoint-version: SharePoint Server 2010,SharePoint Server 2010 > X-AspNet-Version: 2.0.50727 > X-Powered-By: ASP.NET > Date: Fri, 04 Apr 2014 07:16:17 GMT > Content-Length: 2 > > > HTTPSampleResult fields: > ContentType: application/json; charset=utf-8 > DataEncoding: utf-8 > > But document is uploaded 1 KB and file path as its contents. > Real document is not uploaded. > > Please help > > -Vipin > > > > ----- > Vipin Jain > -- > View this message in context: > http://jmeter.512774.n5.nabble.com/passing-byte-stream-to-upload-document-in-HTTP-sampler-Rest-API-tp5719741p5719752.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
