use of org.example.schema.doubleit.DoubleIt4 in project cxf by apache.
the class MTOMSecurityTest method testAsymmetricBinaryBytesInAttachment.
// The difference between this test + the testAsymmetricBytesInAttachment test above is that
// the SOAP Body already contains BASE-64 encoded content.
@org.junit.Test
public void testAsymmetricBinaryBytesInAttachment() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = MTOMSecurityTest.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = MTOMSecurityTest.class.getResource("DoubleItMtom.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricBinaryPort");
DoubleItMtomPortType port = service.getPort(portQName, DoubleItMtomPortType.class);
updateAddressPort(port, PORT);
DataSource source = new FileDataSource(new File("src/test/resources/java.jpg"));
DoubleIt4 doubleIt = new DoubleIt4();
doubleIt.setNumberToDouble(25);
port.doubleIt4(25, new DataHandler(source));
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.example.schema.doubleit.DoubleIt4 in project cxf by apache.
the class MTOMSecurityTest method testAsymmetricBinaryEncryptBeforeSigningBytesInAttachment.
@org.junit.Test
public void testAsymmetricBinaryEncryptBeforeSigningBytesInAttachment() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = MTOMSecurityTest.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = MTOMSecurityTest.class.getResource("DoubleItMtom.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricBinaryEncryptBeforeSigningPort");
DoubleItMtomPortType port = service.getPort(portQName, DoubleItMtomPortType.class);
updateAddressPort(port, PORT);
DataSource source = new FileDataSource(new File("src/test/resources/java.jpg"));
DoubleIt4 doubleIt = new DoubleIt4();
doubleIt.setNumberToDouble(25);
port.doubleIt4(25, new DataHandler(source));
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.example.schema.doubleit.DoubleIt4 in project cxf by apache.
the class MTOMSecurityTest method testSymmetricBinaryBytesInAttachment.
@org.junit.Test
public void testSymmetricBinaryBytesInAttachment() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = MTOMSecurityTest.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = MTOMSecurityTest.class.getResource("DoubleItMtom.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSymmetricBinaryPort");
DoubleItMtomPortType port = service.getPort(portQName, DoubleItMtomPortType.class);
updateAddressPort(port, PORT);
DataSource source = new FileDataSource(new File("src/test/resources/java.jpg"));
DoubleIt4 doubleIt = new DoubleIt4();
doubleIt.setNumberToDouble(25);
port.doubleIt4(25, new DataHandler(source));
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.example.schema.doubleit.DoubleIt4 in project cxf by apache.
the class MTOMSecurityTest method testSignedMTOMAction.
// Sign an attachment without inlining
@org.junit.Test
public void testSignedMTOMAction() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = MTOMSecurityTest.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = MTOMSecurityTest.class.getResource("DoubleItMtom.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSignedMTOMActionPort");
DoubleItMtomPortType port = service.getPort(portQName, DoubleItMtomPortType.class);
updateAddressPort(port, PORT);
DataSource source = new FileDataSource(new File("src/test/resources/java.jpg"));
DoubleIt4 doubleIt = new DoubleIt4();
doubleIt.setNumberToDouble(25);
port.doubleIt4(25, new DataHandler(source));
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.example.schema.doubleit.DoubleIt4 in project cxf by apache.
the class MTOMSecurityTest method testSignedMTOMInline.
// The attachment is inlined + the SOAP Body signed
@org.junit.Test
public void testSignedMTOMInline() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = MTOMSecurityTest.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = MTOMSecurityTest.class.getResource("DoubleItMtom.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSignedMTOMInlinePort");
DoubleItMtomPortType port = service.getPort(portQName, DoubleItMtomPortType.class);
updateAddressPort(port, PORT);
DataSource source = new FileDataSource(new File("src/test/resources/java.jpg"));
DoubleIt4 doubleIt = new DoubleIt4();
doubleIt.setNumberToDouble(25);
port.doubleIt4(25, new DataHandler(source));
((java.io.Closeable) port).close();
bus.shutdown(true);
}
Aggregations