Package javax.xml.soap

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


   
   
    public void testSendReceive_ISO88591_EncodedSOAPMessage() {
        try{
          MimeHeaders mimeHeaders = new MimeHeaders();
            mimeHeaders.addHeader("Content-Type", "text/xml; charset=iso-8859-1");
           
            FileInputStream fileInputStream = new FileInputStream(System.getProperty("basedir", ".") +
                    "/test-resources" + File.separator + "soap-part-iso-8859-1.xml");
            SOAPMessage requestMessage = MessageFactory.newInstance().createMessage(mimeHeaders,fileInputStream);
           
View Full Code Here


            if (uri.startsWith("cid:")) {
                // rfc2392
                uri = "<"+uri.substring("cid:".length())+">";
               
                MimeHeaders headersToMatch = new MimeHeaders();
                headersToMatch.addHeader(MimeConstants.CONTENT_ID, uri);
               
                Iterator i = this.getAttachments(headersToMatch);
                _part = (i == null) ? null : (AttachmentPart)i.next();
                if (_part == null){
                    uri = uri_tmp;
View Full Code Here

                _part = (i == null) ? null : (AttachmentPart)i.next();
                if (_part == null){
                    uri = uri_tmp;
                    uri = uri.substring("cid:".length());
                    headersToMatch = new MimeHeaders();
                    headersToMatch.addHeader(MimeConstants.CONTENT_ID, uri);
               
                    i = this.getAttachments(headersToMatch);
                    _part = (i == null) ? null : (AttachmentPart)i.next();                   
                }
                if (_part == null){
View Full Code Here

                }
                } else {
                String clocation = convertAbsolute2Relative(uri);
               
                MimeHeaders headersToMatch = new MimeHeaders();
                headersToMatch.addHeader(MimeConstants.CONTENT_LOCATION, clocation);
               
                Iterator i = this.getAttachments(headersToMatch);
                _part = (i == null) ? null : (AttachmentPart)i.next();
               
                if (_part == null /*&& !uriNew.toString().startsWith("thismessage:/")*/) {
View Full Code Here

               
                if (_part == null /*&& !uriNew.toString().startsWith("thismessage:/")*/) {
                    // log
                    clocation = uri;
                    headersToMatch.removeAllHeaders();
                    headersToMatch.addHeader(MimeConstants.CONTENT_LOCATION, clocation);
                   
                    i = this.getAttachments(headersToMatch);
                    _part = (i == null) ? null : (AttachmentPart)i.next();
                }
                }
View Full Code Here

        MimeHeaders newHeaders = new MimeHeaders();
        Iterator eachHeader = headers.getAllHeaders();
        while (eachHeader.hasNext()) {
            MimeHeader currentHeader = (MimeHeader) eachHeader.next();

            newHeaders.addHeader(
                currentHeader.getName(),
                currentHeader.getValue());
        }
        return newHeaders;
    }
View Full Code Here

         soapAction = (String)reqContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
         if (soapAction == null)
            throw new IllegalStateException("Cannot obtain: " + BindingProvider.SOAPACTION_URI_PROPERTY);
      }
      MimeHeaders mimeHeaders = reqMsg.getMimeHeaders();
      mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction : "");

      // Get the order of pre/post handlerchains
      HandlerType[] handlerType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
      HandlerType[] faultType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
View Full Code Here

          // Transfer HTTP headers of HTTP message to MIME headers of SOAP message
          Header[] responseHeaders = method.getResponseHeaders();
          MimeHeaders responseMimeHeaders = outMsg.getMimeHeaders();
          for (int i = 0; i < responseHeaders.length; i++) {
            Header responseHeader = responseHeaders[i];
            responseMimeHeaders.addHeader(responseHeader.getName(),
              responseHeader.getValue());
          }
          outMsg.setMessageType(Message.RESPONSE);
          // It's definitely not safe to not release the connection back to the pool until after the
          // successful execution of the following line (which, presumably, registers the
View Full Code Here

                              contentType, contentLocation);
        // Transfer HTTP headers of HTTP message to MIME headers of SOAP message
        MimeHeaders mimeHeaders = outMsg.getMimeHeaders();
        for (Enumeration e = headers.keys(); e.hasMoreElements(); ) {
            String key = (String) e.nextElement();
            mimeHeaders.addHeader(key, ((String) headers.get(key)).trim());
        }       
        outMsg.setMessageType(Message.RESPONSE);
        msgContext.setResponseMessage(outMsg);
        if (log.isDebugEnabled()) {
            if (null == contentLength) {
View Full Code Here

                // Transfer HTTP headers to MIME headers for request message.
                MimeHeaders requestMimeHeaders = requestMsg.getMimeHeaders();
                for (Iterator i = requestHeaders.getAllHeaders(); i.hasNext(); ) {
                    MimeHeader requestHeader = (MimeHeader) i.next();
                    requestMimeHeaders.addHeader(requestHeader.getName(), requestHeader.getValue());
                }
                msgContext.setRequestMessage(requestMsg);
                // put character encoding of request to message context
                // in order to reuse it during the whole process.  
                String requestEncoding = (String) requestMsg.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
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.