Search in sources :

Example 1 with GeneratorDataSource

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);
}
Also used : QName(javax.xml.namespace.QName) GeneratorDataSource(org.jboss.test.ws.jaxws.samples.xop.doclit.GeneratorDataSource) Service(javax.xml.ws.Service) SOAPBinding(javax.xml.ws.soap.SOAPBinding) DataHandler(javax.activation.DataHandler) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Aggregations

URL (java.net.URL)1 DataHandler (javax.activation.DataHandler)1 QName (javax.xml.namespace.QName)1 Service (javax.xml.ws.Service)1 SOAPBinding (javax.xml.ws.soap.SOAPBinding)1 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)1 GeneratorDataSource (org.jboss.test.ws.jaxws.samples.xop.doclit.GeneratorDataSource)1 JBossWSTest (org.jboss.wsf.test.JBossWSTest)1 Test (org.junit.Test)1