Package javax.xml.soap

Examples of javax.xml.soap.SOAPMessage.createAttachmentPart()


        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = (byte) ('a' + ('z' - 'a') * Math.random());
        }

        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        AttachmentPart attachment = request.createAttachmentPart();
        // Per WSI Spect, the swa content id must start with the part name
        //http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html#Value-space_of_Content-Id_Header
        attachment.setContentId("SWAMTOMTestSOAPMessage");
        attachment.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment.setRawContent(bais, "text/plain");
View Full Code Here


        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = (byte) ('a' + ('z' - 'a') * Math.random());
        }

        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        AttachmentPart attachment = request.createAttachmentPart();
        // Per WSI Spect, the swa content id must start with the part name
        //http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html#Value-space_of_Content-Id_Header
        attachment.setContentId("jpegImageRequest=SWAMTOMTestSOAPMessage");
        attachment.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment.setRawContent(bais, "text/plain");
View Full Code Here

        // The attachments are sent out of order.
        // The receiver should be smart enough to use the content id
        // to establish the correct order
        ByteArrayInputStream bais2 = new ByteArrayInputStream(bytes2);
        AttachmentPart attachment2 = request.createAttachmentPart();
        attachment2.setContentId("jpegImage2Request=SWAMTOMTestSOAPMessage");
        attachment2.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment2.setRawContent(bais2, "text/plain");
        request.addAttachmentPart(attachment2);
       
View Full Code Here

        attachment2.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment2.setRawContent(bais2, "text/plain");
        request.addAttachmentPart(attachment2);
       
        ByteArrayInputStream bais1 = new ByteArrayInputStream(bytes1);
        AttachmentPart attachment1 = request.createAttachmentPart();
        attachment1.setContentId("jpegImage1Request=SWAMTOMTestSOAPMessage");
        attachment1.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment1.setRawContent(bais1, "text/plain");
        request.addAttachmentPart(attachment1);
View Full Code Here

       
       
       
        ByteArrayInputStream bais1 = new ByteArrayInputStream(bytes1);
        AttachmentPart attachment1 = request.createAttachmentPart();
        attachment1.setContentId("notCompliant1SWAMTOMTestSOAPMessage");
        attachment1.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment1.setRawContent(bais1, "text/plain");
        request.addAttachmentPart(attachment1);
       
View Full Code Here

        attachment1.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment1.setRawContent(bais1, "text/plain");
        request.addAttachmentPart(attachment1);
       
        ByteArrayInputStream bais2 = new ByteArrayInputStream(bytes2);
        AttachmentPart attachment2 = request.createAttachmentPart();
        attachment2.setContentId("notCompliant2SWAMTOMTestSOAPMessage");
        attachment2.addMimeHeader("FVT-source", "STR_BODY_ELEMENT_1");
        attachment2.setRawContent(bais2, "text/plain");
        request.addAttachmentPart(attachment2);
View Full Code Here

            MessageFactory factory = MessageFactory.newInstance();
            SOAPMessage request = factory.createMessage(null,
                    new ByteArrayInputStream(msg.getBytes()));
           
            // Add the Attachment
            AttachmentPart ap = request.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
            ap.setContentId(SoapMessageProvider.ID);
            request.addAttachmentPart(ap);
           
            // Dispatch
            TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
View Full Code Here

            MessageFactory factory = MessageFactory.newInstance();
            SOAPMessage request = factory.createMessage(null,
                    new ByteArrayInputStream(msg.getBytes()));
           
            // Add the Attachment
            AttachmentPart ap = request.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
            ap.setContentId(SoapMessageProvider.ID);
            request.addAttachmentPart(ap);
           
            // Dispatch
            TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
View Full Code Here

            MessageFactory factory = MessageFactory.newInstance();
            SOAPMessage request = factory.createMessage(null,
                    new ByteArrayInputStream(msg.getBytes()));
           
            // Add the Attachment
            AttachmentPart ap = request.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
            ap.setContentId(SoapMessageProvider.ID);
            request.addAttachmentPart(ap);
           
            // Dispatch
            TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
View Full Code Here

            SOAPFault sf = body.addFault();


            InputStream in1 = new FileInputStream(new File(System.getProperty("basedir", ".") +
                    "/target/test-resources" + File.separator + "attach.xml"));
            ap1 = msg.createAttachmentPart(in1, "text/xml");
            msg.addAttachmentPart(ap1);

            InputStream in2 = new FileInputStream(new File(System.getProperty("basedir", ".") +
                    "/target/test-resources" + File.separator + "axis2.xml"));
            ap2 = msg.createAttachmentPart(in2, "text/xml");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.