Discussion:
How to post an XML file using a Jersey Client?
amrutad
2011-12-15 11:00:19 UTC
Permalink
final WebResource service =
client.resource(UriBuilder.fromUri(WSURI).build());
service.type(MediaType.APPLICATION_XML);
service.accept(MediaType.TEXT_PLAIN);
final Builder builder = service.header(HttpHeaders.AUTHORIZATION,
HEADER);

File file = new File("/test.xml");
builder.entity(file);
final ClientResponse response = builder.post(ClientResponse.class);


I want to send an XML file and receive the response back. The code that I am
trying gives 400 BAD request, please could someone help. I am not sure what
is going wrong here.

--
View this message in context: http://jersey.576304.n2.nabble.com/How-to-post-an-XML-file-using-a-Jersey-Client-tp7096733p7096733.html
Sent from the Jersey mailing list archive at Nabble.com.

Loading...