camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siddharth Patil <siddharth.pa...@infrasofttech.com>
Subject Passing Files and String to REST service in Camel.
Date Wed, 28 Dec 2016 09:23:49 GMT
Hi,

I want to create a web service which accepts files(.png, .pdf, .txt) and
a String. Previously I created a service that accepts only files and the
structure of the service is as shown below :

@POST
@Path("/uploadDoc")
@Consumes("multipart/form-data")
@Produces(MediaType.APPLICATION_JSON)
public Response uploadFile(final MultipartBody uploadedFile);

This is working fine.

Now I want a service that accepts String as well along with files. Here
is my HTML page layout through which I will be hitting the service :

<html>
<body>
<h1>JAX-RS Upload Form</h1>

<form
action="http://localhost:8080/IntegrationHub/hubServices/file/uploadDoc"
method="post" enctype="multipart/form-data">

<p>
Account Number : <input type="text" name="accountNumber">
</p>
<p>
Select a file : <input type="file" name="uploadedFile"/ multiple>
</p>

<input type="submit" value="Upload It" />
</form>

</body>
</html>


Please help.

Regards,
Siddharth Patil
Infrasoft Technologies Limited
Tel: +91 20 6629 3416
www.infrasofttech.com

InfrasoftTech is a specialist solutions & services company for the
Banking & Finance and Insurance Industry. We are a SEI CMMI Level 5 v1.3,
ISO 9001 and ISO 27001 certified company having a global footprint with
over 200 client banks and operations in United Kingdom, Channel Islands,
U.S.A., Canada, India, Dubai, Singapore & Africa and a global Channel
partner network in over 20 countries

Notice:
This correspondence may contain some privileged information. We cannot be
held responsible in any manner for any misuse of this correspondence. If
you are not the intended recipient of this email (including attachments
if any) and have received the same in error, kindly delete the same,
without retaining any copy in soft or printed form and inform the sender.
---------------------------------------------------------------------------------------
This email has been scanned for email related threats and delivered
safely by Mimecast.
For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------











--
View this message in context: http://camel.465427.n5.nabble.com/Passing-Files-and-String-to-REST-service-in-Camel-tp5791968.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message