/** * Returns the character set encoding scheme. If the value of the charSetEncoding is not set * then the default will be returned. * * @return Returns encoding. */ public String getCharSetEncoding() { return format.getCharSetEncoding(); }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType = "text/plain"; if (encoding != null) { contentType += "; charset=" + encoding; } // if soap action is there (can be there is soap response MEP is used) add it. if ((soapAction != null) && !"".equals(soapAction.trim()) && !"\"\"".equals(soapAction.trim())) { contentType = contentType + ";action=\"" + soapAction + "\";"; } return contentType; }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType = "text/plain"; if (encoding != null) { contentType += "; charset=" + encoding; } // if soap action is there (can be there is soap response MEP is used) add it. if ((soapAction != null) && !"".equals(soapAction.trim()) && !"\"\"".equals(soapAction.trim())) { contentType = contentType + ";action=\"" + soapAction + "\";"; } return contentType; }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType = HTTPConstants.MEDIA_TYPE_X_WWW_FORM; if (encoding != null) { contentType += "; charset=" + encoding; } // if soap action is there (can be there is soap response MEP is used) add it. if ((soapAction != null) && !"".equals(soapAction.trim()) && !"\"\"".equals(soapAction.trim())) { contentType = contentType + ";action=\"" + soapAction + "\";"; } return contentType; }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType = HTTPConstants.MEDIA_TYPE_X_WWW_FORM; if (encoding != null) { contentType += "; charset=" + encoding; } // if soap action is there (can be there is soap response MEP is used) add it. if ((soapAction != null) && !"".equals(soapAction.trim()) && !"\"\"".equals(soapAction.trim())) { contentType = contentType + ";action=\"" + soapAction + "\";"; } return contentType; }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction) { String encoding = format.getCharSetEncoding(); String contentType = HTTPConstants.MEDIA_TYPE_X_WWW_FORM; if (encoding != null) { contentType += "; charset=" + encoding; } // if soap action is there (can be there is soap response MEP is used) add it. if ((soapAction != null) && !"".equals(soapAction.trim()) && !"\"\"".equals(soapAction.trim())) { contentType = contentType + ";action=\"" + soapAction + "\";"; } return contentType; }
public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException { if (log.isDebugEnabled()) { log.debug("serialize output="+output+" format="+format); } try { // Write bytes to the output stream output.write(getXMLBytes(format.getCharSetEncoding())); } catch (IOException e) { throw new XMLStreamException(e); } }
public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException { if (log.isDebugEnabled()) { log.debug("serialize writer="+writer+" format="+format); } try { // Convert the bytes into a String and write it to the Writer String text = new String(getXMLBytes(format.getCharSetEncoding())); writer.write(text); } catch (UnsupportedEncodingException e) { throw new XMLStreamException(e); } catch (IOException e) { throw new XMLStreamException(e); } }
public void writeTo(MessageContext messageContext, OMOutputFormat format, OutputStream outputStream, boolean preserve) throws AxisFault { OMElement textElt = messageContext.getEnvelope().getBody().getFirstElement(); if (BaseConstants.DEFAULT_TEXT_WRAPPER.equals(textElt.getQName())) { try { Writer out = new OutputStreamWriter(outputStream, format.getCharSetEncoding()); textElt.writeTextTo(out, preserve); out.flush(); } catch (IOException e) { throw new AxisFault("Error writing text message to stream", e); } } }
public void writeTo(MessageContext messageContext, OMOutputFormat format, OutputStream outputStream, boolean preserve) throws AxisFault { OMElement textElt = messageContext.getEnvelope().getBody().getFirstElement(); if (BaseConstants.DEFAULT_TEXT_WRAPPER.equals(textElt.getQName())) { try { Writer out = new OutputStreamWriter(outputStream, format.getCharSetEncoding()); textElt.writeTextTo(out, preserve); out.flush(); } catch (IOException e) { throw new AxisFault("Error writing text message to stream", e); } } }
public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException { XMLStreamWriter streamWriter; if (format != null && StringUtils.hasLength(format.getCharSetEncoding())) { streamWriter = StAXUtils.createXMLStreamWriter(output, format.getCharSetEncoding()); } else { streamWriter = StAXUtils.createXMLStreamWriter(output); } serialize(streamWriter); }
public String getContentTypeAsString() { String encoding = format.getCharSetEncoding(); String contentType = format.getContentType(); if (encoding != null) { contentType += "; charset=" + encoding; } // action header is not mandated in SOAP 1.2. So putting it, if available if (!msgCtxt.isSOAP11() && (soapActionString != null) && !"".equals(soapActionString.trim()) && !"\"\"".equals(soapActionString.trim())) { contentType = contentType + ";action=\"" + soapActionString + "\";"; } return contentType; }
public String getContentType(MessageContext msgCtxt, OMOutputFormat format, String soapActionString) { String contentType = (String) msgCtxt.getProperty(Constants.Configuration.CONTENT_TYPE); String encoding = format.getCharSetEncoding(); if (contentType == null) { contentType = (String) msgCtxt.getProperty(Constants.Configuration.MESSAGE_TYPE); } if (encoding != null) { contentType += "; charset=" + encoding; } return contentType; }
public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException { if (data == null) { throw new OMException("The InputStreamDataSource does not have a backing object"); } String encoding = format.getCharSetEncoding(); try { if (!data.encoding.equalsIgnoreCase(encoding)) { byte[] bytes = getXMLBytes(encoding); output.write(bytes); } else { // Write the input stream to the output stream inputStream2OutputStream(data.is, output); } } catch (UnsupportedEncodingException e) { throw new XMLStreamException(e); } catch (IOException e) { throw new XMLStreamException(e); } }
protected abstract XMLStreamWriter getJSONWriter(Writer writer, MessageContext messageContext) throws XMLStreamException;
public String getContentType(MessageContext msgCtxt, OMOutputFormat format, String soapActionString) { String contentType = (String)msgCtxt.getProperty(Constants.Configuration.CONTENT_TYPE); String encoding = format.getCharSetEncoding(); if (contentType == null) { contentType = (String)msgCtxt.getProperty(Constants.Configuration.MESSAGE_TYPE); } if (encoding != null) { contentType += "; charset=" + encoding; } return contentType; }
public DataSource getDataSource(MessageContext messageContext, OMOutputFormat format, String soapAction) throws AxisFault { return new TextFromElementDataSource( messageContext.getEnvelope().getBody().getFirstElement(), format.getCharSetEncoding(), getContentType(messageContext, format, soapAction)); } }
public DataSource getDataSource(MessageContext messageContext, OMOutputFormat format, String soapAction) throws AxisFault { return new TextFromElementDataSource( messageContext.getEnvelope().getBody().getFirstElement(), format.getCharSetEncoding(), getContentType(messageContext, format, soapAction)); } }
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapActionString) { String contentType = (String) messageContext.getProperty(Constants.Configuration.CONTENT_TYPE); String encoding = format.getCharSetEncoding(); if (contentType == null) { contentType = (String) messageContext.getProperty(Constants.Configuration.MESSAGE_TYPE); } if (encoding != null) { contentType += "; charset=" + encoding; } return contentType; }
public String getContentType(MessageContext msgCtxt, OMOutputFormat format, String soapActionString) { String contentType = (String)msgCtxt.getProperty(Constants.Configuration.CONTENT_TYPE); String encoding = format.getCharSetEncoding(); if (contentType == null) { contentType = (String)msgCtxt.getProperty(Constants.Configuration.MESSAGE_TYPE); } if (encoding != null) { contentType += "; charset=" + encoding; } return contentType; }