Examples of countAttachments()


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

                //MTOM is always enabled
                Element xopInclude = findElementNode(soapMessage.getSOAPBody(), "include");
                //include element should be find in the soap message
                Assert.assertNotNull(xopInclude);
                //Attachment size should be 1
                int attachments = soapMessage.countAttachments();
                if (attachments == 0) {
                    LOG.warn("Expected 1 attachment but got 0");
                } else if (attachments == 1) {
                    // that's what we expect
                } else {
View Full Code Here

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

                Element useMTOMElement = findElementNode(soapMessage.getSOAPBody(), "useMTOM");
                if (useMTOMElement != null) {
                    String sUseMTOM = getSubTextChildValue(useMTOMElement);
                    //If the useMTOM is true, the attachment size should be 1, or the attachment size should be 0
                    if (Boolean.parseBoolean(sUseMTOM))
                        Assert.assertEquals(soapMessage.countAttachments(), 1);
                    else
                        Assert.assertEquals(soapMessage.countAttachments(), 0);
                }
            }
        } catch (Exception e) {
View Full Code Here

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

                    String sUseMTOM = getSubTextChildValue(useMTOMElement);
                    //If the useMTOM is true, the attachment size should be 1, or the attachment size should be 0
                    if (Boolean.parseBoolean(sUseMTOM))
                        Assert.assertEquals(soapMessage.countAttachments(), 1);
                    else
                        Assert.assertEquals(soapMessage.countAttachments(), 0);
                }
            }
        } catch (Exception e) {
            return false;
        }
View Full Code Here

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

    public T invoke(T obj, boolean isOneWay) {
        checkError();
        try {
            if (obj instanceof SOAPMessage) {
                SOAPMessage msg = (SOAPMessage)obj;
                if (msg.countAttachments() > 0) {
                    client.getRequestContext().put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
                }
            }
            QName opName = (QName)getRequestContext().get(MessageContext.WSDL_OPERATION);
            if (opName == null) {
View Full Code Here

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

        public void handleMessage(SoapMessage message) throws Fault {
            SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
            if (soapMessage != null) {
                if (soapMessage.countAttachments() > 0) {
                    if (message.getAttachments() == null) {
                        message.setAttachments(new ArrayList<Attachment>(soapMessage
                                .countAttachments()));
                    }
                    Iterator<AttachmentPart> it = CastUtils.cast(soapMessage.getAttachments());
View Full Code Here

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

            SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
            if (soapMessage != null) {
                if (soapMessage.countAttachments() > 0) {
                    if (message.getAttachments() == null) {
                        message.setAttachments(new ArrayList<Attachment>(soapMessage
                                .countAttachments()));
                    }
                    Iterator<AttachmentPart> it = CastUtils.cast(soapMessage.getAttachments());
                    while (it.hasNext()) {
                        AttachmentPart part = it.next();
View Full Code Here

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

    public T invoke(T obj, boolean isOneWay) {
        checkError();
        try {
            if (obj instanceof SOAPMessage) {
                SOAPMessage msg = (SOAPMessage)obj;
                if (msg.countAttachments() > 0) {
                    client.getRequestContext().put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
                }
            }
            QName opName = (QName)getRequestContext().get(MessageContext.WSDL_OPERATION);
            if (opName == null) {
View Full Code Here

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

        SOAPConnection con = conFac.createConnection();
        URL endpoint = new URL("http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit1");
        SOAPMessage response = con.call(msg, endpoint);
        QName sayHiResp = new QName("http://apache.org/hello_world_rpclit", "sayHiResponse");
        assertNotNull(response.getSOAPBody().getChildElements(sayHiResp));
        assertEquals(2, response.countAttachments());
    }

    private void doGreeterRPCLit(SOAPServiceRPCLit service,
                                 QName portName,
                                 int count,
View Full Code Here

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

        StaxSource createdSource = null;
        checkError();       
        try {
            if (obj instanceof SOAPMessage) {
                SOAPMessage msg = (SOAPMessage)obj;
                if (msg.countAttachments() > 0) {
                    client.getRequestContext().put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
                }
            } else if (context != null) {
                Boolean unwrapProperty = obj instanceof JAXBElement ? Boolean.FALSE : Boolean.TRUE;
                getRequestContext().put("unwrap.jaxb.element", unwrapProperty);
View Full Code Here

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

        StaxSource createdSource = null;
        checkError();       
        try {
            if (obj instanceof SOAPMessage) {
                SOAPMessage msg = (SOAPMessage)obj;
                if (msg.countAttachments() > 0) {
                    client.getRequestContext().put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
                }
            } else if (context != null) {
                Boolean unwrapProperty = obj instanceof JAXBElement ? Boolean.FALSE : Boolean.TRUE;
                getRequestContext().put("unwrap.jaxb.element", unwrapProperty);
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.