use of com.consol.citrus.ws.validation.BinarySoapAttachmentValidator in project citrus-samples by christophd.
the class GetImageIT method testGetImageMtom.
@Test
@CitrusTest
public void testGetImageMtom() {
SoapAttachment attachment = new SoapAttachment();
attachment.setContentId("IMAGE");
attachment.setContentType("image/png");
attachment.setCharsetName("utf-8");
attachment.setContentResourcePath("image/logo.png");
soap().client(imageClient).send().fork(true).soapAction("getImage").payload("<image:getImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>IMAGE</image:id>" + "</image:getImage>");
soap().server(imageServer).receive().soapAction("getImage").payload("<image:getImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>IMAGE</image:id>" + "</image:getImage>");
soap().server(imageServer).send().payload("<image:getImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:image>cid:IMAGE</image:image>" + "</image:getImageResponse>").attachment(attachment).mtomEnabled(true);
soap().client(imageClient).receive().schemaValidation(false).payload("<image:getImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:image>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:IMAGE\"/>" + "</image:image>" + "</image:getImageResponse>").attachmentValidator(new BinarySoapAttachmentValidator()).attachment(attachment);
}
use of com.consol.citrus.ws.validation.BinarySoapAttachmentValidator in project citrus-samples by christophd.
the class AddImageIT method testAddImageMtom.
@Test
@CitrusTest
public void testAddImageMtom() {
SoapAttachment attachment = new SoapAttachment();
attachment.setContentId("IMAGE");
attachment.setContentType("image/png");
attachment.setCharsetName("utf-8");
attachment.setContentResourcePath("image/logo.png");
soap().client(imageClient).send().fork(true).soapAction("addImage").payload("<image:addImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>logo</image:id>" + "<image:image>cid:IMAGE</image:image>" + "</image:addImage>").attachment(attachment).mtomEnabled(true);
soap().server(imageServer).receive().soapAction("addImage").schemaValidation(false).payload("<image:addImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>logo</image:id>" + "<image:image>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:IMAGE\"/>" + "</image:image>" + "</image:addImage>").attachmentValidator(new BinarySoapAttachmentValidator()).attachment(attachment);
soap().server(imageServer).send().payload("<image:addImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:success>true</image:success>" + "</image:addImageResponse>");
soap().client(imageClient).receive().payload("<image:addImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:success>true</image:success>" + "</image:addImageResponse>");
}
Aggregations