Package javax.xml.soap

Examples of javax.xml.soap.MimeHeaders.addHeader()


                iterator.next();
            }
            assertEquals(cnt, 3);
            //remove just the text/xml attachments
            MimeHeaders mhs = new MimeHeaders();
            mhs.addHeader("Content-Type", "text/xml");
            msg.removeAttachments(mhs);

            //get all attachments
            iterator = msg.getAttachments();
            cnt = 0;
View Full Code Here


               
                // Axiom doesn't give us access to the MIME headers of the individual
                // parts of the SOAP message package. We need to reconstruct them from
                // the available information.
                MimeHeaders soapPartHeaders = new MimeHeaders();
                soapPartHeaders.addHeader(HTTPConstants.HEADER_CONTENT_TYPE,
                        attachments.getSOAPPartContentType());
                String soapPartContentId = attachments.getSOAPPartContentID();
                soapPartHeaders.addHeader("Content-ID", "<" + soapPartContentId + ">");
               
                soapPart = new SOAPPartImpl(this, attachments.getSOAPPartInputStream(),
View Full Code Here

                // the available information.
                MimeHeaders soapPartHeaders = new MimeHeaders();
                soapPartHeaders.addHeader(HTTPConstants.HEADER_CONTENT_TYPE,
                        attachments.getSOAPPartContentType());
                String soapPartContentId = attachments.getSOAPPartContentID();
                soapPartHeaders.addHeader("Content-ID", "<" + soapPartContentId + ">");
               
                soapPart = new SOAPPartImpl(this, attachments.getSOAPPartInputStream(),
                        soapPartHeaders, processMTOM ? attachments : null);
               
                for (String contentId : attachments.getAllContentIDs()) {
View Full Code Here

  }
  */
 
  protected void testToNMS(MessageFactory messageFactory) throws Exception {
    MimeHeaders headers = new MimeHeaders();
    headers.addHeader("Content-Type", "text/xml;");
    InputStream is = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/components/http/soap-response.xml");
    SOAPMessage sm = messageFactory.createMessage(headers, is);
    NormalizedMessage nm = new NormalizedMessageImpl();
    new SaajMarshaler().toNMS(nm, sm);

View Full Code Here

        assertEquals("string", qname.getLocalPart());
  }
 
  protected void testCreateSOAPMessage(MessageFactory messageFactory) throws Exception {
        MimeHeaders headers = new MimeHeaders();
        headers.addHeader("Content-Type", "text/xml;");
        
        InputStream is = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/components/saaj/xml-request.xml");        
        logger.info("Raw XML: {}", new SourceTransformer().toString(new StreamSource(is)));
        
        is = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/components/saaj/xml-request.xml");        
View Full Code Here

        try {
            SOAPMessage inMessage = marshaler.createSOAPMessage(in);
            MimeHeaders mh = inMessage.getMimeHeaders();
            if (mh.getHeader("SOAPAction") == null) {
                if (soapAction != null && soapAction.length() > 0) {
                    mh.addHeader("SOAPAction", soapAction);
                } else {
                    mh.addHeader("SOAPAction", "\"\"");
                }
                inMessage.saveChanges();
            }
View Full Code Here

            MimeHeaders mh = inMessage.getMimeHeaders();
            if (mh.getHeader("SOAPAction") == null) {
                if (soapAction != null && soapAction.length() > 0) {
                    mh.addHeader("SOAPAction", soapAction);
                } else {
                    mh.addHeader("SOAPAction", "\"\"");
                }
                inMessage.saveChanges();
            }

            if (logger.isDebugEnabled()) {
View Full Code Here

        MimeHeaders headers = new MimeHeaders();

        while (e.hasMoreElements()) {
            String headerName = (String)e.nextElement();
            String headerValue = request.getHeader(headerName);
            headers.addHeader(headerName, headerValue);
        }

        return headers;
    }
   
View Full Code Here

                    }

                    if (key != null) {
                        StringTokenizer values = new StringTokenizer(value, ",");
                        while (values.hasMoreTokens()) {
                            mimeHeaders.addHeader(key, values.nextToken().trim());
                        }
                    }
                    i++;
                }
                InputStream httpInputStream;
View Full Code Here

    public void testEnvelope2() throws Exception {
        MessageFactory mf = MessageFactory.newInstance();
        final ByteArrayInputStream baIS = new ByteArrayInputStream(XML_STRING.getBytes());
        final MimeHeaders mimeheaders = new MimeHeaders();
        mimeheaders.addHeader("Content-Type", "text/xml");
        SOAPMessage smsg =
                mf.createMessage(mimeheaders, baIS);

        SOAPEnvelope envelope = smsg.getSOAPPart().getEnvelope();
        SOAPBody body = envelope.getBody();
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.