Package org.apache.camel.component.cxf.jaxrs.simplebinding.testbean

Examples of org.apache.camel.component.cxf.jaxrs.simplebinding.testbean.Customer


        HttpPost post = new HttpPost("http://localhost:" + PORT_PATH + "/rest/customerservice/customers/multipart");
        MultipartEntity multipart = new MultipartEntity(HttpMultipartMode.STRICT);
        multipart.addPart("part1", new FileBody(new File(this.getClass().getClassLoader().getResource("java.jpg").toURI()), "java.jpg"));
        multipart.addPart("part2", new FileBody(new File(this.getClass().getClassLoader().getResource("java.jpg").toURI()), "java.jpg"));
        StringWriter sw = new StringWriter();
        jaxb.createMarshaller().marshal(new Customer(123, "Raul"), sw);
        multipart.addPart("body", new StringBody(sw.toString(), "text/xml", Charset.forName("UTF-8")));
        post.setEntity(multipart);
        HttpResponse response = httpclient.execute(post);
        assertEquals(200, response.getStatusLine().getStatusCode());
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.cxf.jaxrs.simplebinding.testbean.Customer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.