private void writeOut(MessageContext msgContext, Socket socket, String contentType) throws IOException { MessageFormatter messageFormatter = MessageProcessorSelector.getMessageFormatter(msgContext); OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); format.setContentType(contentType); byte[] payload = messageFormatter.getBytes(msgContext, format); OutputStream out = socket.getOutputStream(); out.write(payload); out.flush(); }
private void writeOut(MessageContext msgContext, Socket socket, String contentType) throws IOException { MessageFormatter messageFormatter = MessageProcessorSelector.getMessageFormatter(msgContext); OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); format.setContentType(contentType); OutputStream out = socket.getOutputStream(); messageFormatter.writeTo(msgContext, format, out, false); out.flush(); }
/** * Format the messages when the messages are sent to the kafka broker */ public static String formatMessage( org.apache.axis2.context.MessageContext messageContext) throws AxisFault { OMOutputFormat format = BaseUtils.getOMOutputFormat(messageContext); MessageFormatter messageFormatter = MessageProcessorSelector.getMessageFormatter(messageContext); ; StringWriter stringWriter = new StringWriter(); OutputStream out = new WriterOutputStream(stringWriter, format.getCharSetEncoding()); try { messageFormatter.writeTo(messageContext, format, out, true); } catch (IOException e) { throw new AxisFault("The Error occurs while formatting the message", e); } finally { try { out.close(); } catch (Exception e) { throw new AxisFault("The Error occurs while closing the output stream", e); } } return stringWriter.toString(); } }
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); format.setContentType(udpOutInfo.getContentType()); ByteArrayOutputStream out = new ByteArrayOutputStream();
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); format.setContentType(udpOutInfo.getContentType()); byte[] payload = messageFormatter.getBytes(msgContext, format);
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); format.setContentType(udpOutInfo.getContentType()); byte[] payload = messageFormatter.getBytes(msgContext, format);
private MqttMessage createMqttMessage(MessageContext messageContext) { OMOutputFormat format = BaseUtils.getOMOutputFormat(messageContext); MessageFormatter messageFormatter; try { messageFormatter = MessageProcessorSelector.getMessageFormatter(messageContext); } catch (AxisFault axisFault) { throw new AxisMqttException("Unable to get the message formatter to use"); } OutputStream out; StringWriter sw = new StringWriter(); try { out = new WriterOutputStream(sw, format.getCharSetEncoding()); } catch (UnsupportedCharsetException ex) { throw new AxisMqttException("Unsupported encoding " + format.getCharSetEncoding(), ex); } try { messageFormatter.writeTo(messageContext, format, out, true); out.close(); } catch (IOException e) { throw new AxisMqttException("IO Error while creating BytesMessage", e); } MqttMessage mqttMessage = new MqttMessage(); mqttMessage.setPayload(sw.toString().getBytes()); return mqttMessage; } }
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); MessageFormatter messageFormatter = null; ByteArrayOutputStream out = new ByteArrayOutputStream();
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); MessageFormatter messageFormatter = null; ByteArrayOutputStream out = new ByteArrayOutputStream();
throws AxisFault, MessagingException, IOException { OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
throws AxisFault, MessagingException, IOException { OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
throws AxisFault, MessagingException, IOException { OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); MessageFormatter messageFormatter = null; try {
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); MessageFormatter messageFormatter = null; try {
thriftMsg.setSoapAction(msgContext.getSoapAction()); OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); ByteArrayOutputStream out = new ByteArrayOutputStream(); formatter.writeTo(msgContext, format, out, false);
private void populateResponseFile(FileObject responseFile, MessageContext msgContext, boolean append, boolean lockingEnabled, FileSystemOptions fso) throws AxisFault { MessageFormatter messageFormatter = getMessageFormatter(msgContext); OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);