I need to send the request XML file to {url} as multipart form data. How this do in Restful web service. Before I use in there in,
RequestDispatcher rd = request.getRequestDispatcher("/file/message.jsp");
rd.forward(request, response);
But this isn't sent in specific {url}, How to sent it?
I don't think web service is best choice for you
you can try native stream and then you can write the header and the body as you like here is sample code to explain my point
If you can do it (depends on your context), using a JAX-RS client is a solution.
Example with Apache CXF :
You can use the
Jersey Rest Client
to send your XML message aspost request
.For Jersey Client you can find documentation here:
Jersey REST Client
WebResource