Skip to content
Permalink
Browse files
Required code level changes from AXIS2-5374 and a test case fix.
  • Loading branch information
Sagara Gunathunga committed Sep 19, 2012
1 parent 6dbbf27 commit 9771097f709071a10c5b58d5dcf4a7e9002026f0
Showing 6 changed files with 12 additions and 6 deletions.
@@ -34,6 +34,7 @@
import org.apache.axis2.format.PlainTextFormatter;
import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.TransportUtils;
import org.apache.axis2.util.MessageProcessorSelector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -156,7 +157,7 @@ public static MessageFormatter getMessageFormatter(MessageContext msgContext) {

// ... otherwise, let Axis choose the right message formatter:
try {
return TransportUtils.getMessageFormatter(msgContext);
return MessageProcessorSelector.getMessageFormatter(msgContext);
} catch (AxisFault axisFault) {
throw new BaseTransportException("Unable to get the message formatter to use");
}
@@ -19,12 +19,12 @@
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMText;
import org.apache.axiom.om.OMNode;
import org.apache.axis2.util.MessageProcessorSelector;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.transport.TransportUtils;
import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.OutTransportInfo;
import org.apache.axis2.transport.base.*;
@@ -343,7 +343,7 @@ private Message createJMSMessage(MessageContext msgContext, Session session,
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
MessageFormatter messageFormatter = null;
try {
messageFormatter = TransportUtils.getMessageFormatter(msgContext);
messageFormatter = MessageProcessorSelector.getMessageFormatter(msgContext);
} catch (AxisFault axisFault) {
throw new JMSException("Unable to get the message formatter to use");
}
@@ -22,6 +22,7 @@
import org.apache.axis2.builder.BuilderUtil;
import org.apache.axis2.builder.SOAPBuilder;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.util.MessageProcessorSelector;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.format.DataSourceMessageBuilder;
import org.apache.axis2.format.TextMessageBuilder;
@@ -130,7 +131,7 @@ public static void setSOAPEnvelope(Message message, MessageContext msgContext, S

int index = contentType.indexOf(';');
String type = index > 0 ? contentType.substring(0, index) : contentType;
Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
Builder builder = MessageProcessorSelector.getMessageBuilder(type, msgContext);
if (builder == null) {
if (log.isDebugEnabled()) {
log.debug("No message builder found for type '" + type + "'. Falling back to SOAP.");
@@ -31,6 +31,7 @@
import org.apache.axis2.transport.base.BaseUtils;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axis2.util.MessageProcessorSelector;

import java.io.IOException;
import java.io.OutputStream;
@@ -84,7 +85,7 @@ public void sendMessage(MessageContext msgContext, String targetEPR,

private void writeOut(MessageContext msgContext, Socket socket,
String contentType) throws IOException {
MessageFormatter messageFormatter = TransportUtils.getMessageFormatter(msgContext);
MessageFormatter messageFormatter = MessageProcessorSelector.getMessageFormatter(msgContext);
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
format.setContentType(contentType);
byte[] payload = messageFormatter.getBytes(msgContext, format);
@@ -118,6 +118,8 @@ protected MessageContext send(ClientOptions options, AxisMessage message, QName
mc.setProperty(BaseConstants.METRICS_COLLECTOR, metrics);
}
mepClient.addMessageContext(mc);
mepClient.getOptions().setAction("");

mepClient.execute(block);
// mepClient.complete(mc);
return resultMessageLabel == null ? null : mepClient.getMessageContext(resultMessageLabel);
@@ -37,6 +37,7 @@
import org.apache.axis2.transport.TransportUtils;
import org.apache.axis2.transport.base.AbstractTransportSender;
import org.apache.axis2.transport.base.BaseUtils;
import org.apache.axis2.util.MessageProcessorSelector;
import org.apache.commons.logging.LogFactory;

import javax.xml.stream.XMLStreamException;
@@ -67,7 +68,7 @@ public void sendMessage(MessageContext msgContext, String targetEPR,
} else {
udpOutInfo = new UDPOutTransportInfo(targetEPR);
}
MessageFormatter messageFormatter = TransportUtils.getMessageFormatter(msgContext);
MessageFormatter messageFormatter = MessageProcessorSelector.getMessageFormatter(msgContext);
OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
format.setContentType(udpOutInfo.getContentType());
byte[] payload = messageFormatter.getBytes(msgContext, format);

0 comments on commit 9771097

Please sign in to comment.