use of org.jboss.test.ws.jaxws.samples.xop.doclit.GeneratorDataSource in project jbossws-cxf by jbossws.
the class JBWS2000TestCase method testFileTransfer.
@Test
@RunAsClient
public void testFileTransfer() throws Exception {
URL wsdlURL = new URL(baseURL + "/jaxws-jbws2000/FileTransfer?wsdl");
QName serviceName = new QName("http://service.mtom.test.net/", "FileTransferServiceImplService");
Service service = Service.create(wsdlURL, serviceName);
FileTransferService port = service.getPort(FileTransferService.class);
SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
binding.setMTOMEnabled(true);
// avoid going beyond Undertow default max post size
GeneratorDataSource source = new GeneratorDataSource(1024 * 1204 * 8);
DataHandler dh = new DataHandler(source);
boolean success = port.transferFile("JBWS2000.data", dh);
assertTrue("Failed to transfer file", success);
}
Aggregations