Search in sources :

Example 1 with SoapAttachment

use of com.consol.citrus.ws.message.SoapAttachment 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);
}
Also used : SoapAttachment(com.consol.citrus.ws.message.SoapAttachment) BinarySoapAttachmentValidator(com.consol.citrus.ws.validation.BinarySoapAttachmentValidator) CitrusTest(com.consol.citrus.annotations.CitrusTest) Test(org.testng.annotations.Test) CitrusTest(com.consol.citrus.annotations.CitrusTest)

Example 2 with SoapAttachment

use of com.consol.citrus.ws.message.SoapAttachment in project citrus-samples by christophd.

the class GetImageIT method testGetImageMtomInline.

@Test
@CitrusTest
public void testGetImageMtomInline() {
    SoapAttachment attachment = new SoapAttachment();
    attachment.setContentId("IMAGE");
    attachment.setContentType("image/png");
    attachment.setCharsetName("utf-8");
    attachment.setContentResourcePath("image/logo.png");
    attachment.setMtomInline(true);
    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().payload("<image:getImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:image>citrus:readFile(image/logo.base64)</image:image>" + "</image:getImageResponse>");
}
Also used : SoapAttachment(com.consol.citrus.ws.message.SoapAttachment) CitrusTest(com.consol.citrus.annotations.CitrusTest) Test(org.testng.annotations.Test) CitrusTest(com.consol.citrus.annotations.CitrusTest)

Example 3 with SoapAttachment

use of com.consol.citrus.ws.message.SoapAttachment 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>");
}
Also used : SoapAttachment(com.consol.citrus.ws.message.SoapAttachment) BinarySoapAttachmentValidator(com.consol.citrus.ws.validation.BinarySoapAttachmentValidator) CitrusTest(com.consol.citrus.annotations.CitrusTest) Test(org.testng.annotations.Test) CitrusTest(com.consol.citrus.annotations.CitrusTest)

Example 4 with SoapAttachment

use of com.consol.citrus.ws.message.SoapAttachment in project citrus-samples by christophd.

the class AddImageIT method testAddImageMtomInline.

@Test
@CitrusTest
public void testAddImageMtomInline() {
    SoapAttachment attachment = new SoapAttachment();
    attachment.setContentId("IMAGE");
    attachment.setContentType("image/png");
    attachment.setCharsetName("utf-8");
    attachment.setContentResourcePath("image/logo.png");
    attachment.setMtomInline(true);
    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").payload("<image:addImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>logo</image:id>" + "<image:image>citrus:readFile(image/logo.base64)</image:image>" + "</image:addImage>");
    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>");
}
Also used : SoapAttachment(com.consol.citrus.ws.message.SoapAttachment) CitrusTest(com.consol.citrus.annotations.CitrusTest) Test(org.testng.annotations.Test) CitrusTest(com.consol.citrus.annotations.CitrusTest)

Aggregations

CitrusTest (com.consol.citrus.annotations.CitrusTest)4 SoapAttachment (com.consol.citrus.ws.message.SoapAttachment)4 Test (org.testng.annotations.Test)4 BinarySoapAttachmentValidator (com.consol.citrus.ws.validation.BinarySoapAttachmentValidator)2