if (channel.getChannelId() == frame.getChannelId()) {
switch (frame.getHeader().getFrameType()) {
case SoapTcpFrameHeader.SINGLE_FRAME_MESSAGE:
case SoapTcpFrameHeader.ERROR_MESSAGE:
case SoapTcpFrameHeader.NULL_MESSAGE:
SoapTcpMessage singleFrameMessage = SoapTcpMessage.createSoapTcpMessage(frame);
out.write(singleFrameMessage);
bufferPosition = 0;
bufferDataLength = 0;
break;
case SoapTcpFrameHeader.MESSAGE_START_CHUNK:
case SoapTcpFrameHeader.MESSAGE_CHUNK:
channel.addFrame(frame);
bufferPosition = 0;
bufferDataLength = 0;
break;
case SoapTcpFrameHeader.MESSAGE_END_CHUNK:
List<SoapTcpFrame> frames = channel.getFrames();
SoapTcpMessage multiFrameMessage = SoapTcpMessage.createSoapTcpMessage(frames);
multiFrameMessage.getFrames().add(frame);
out.write(multiFrameMessage);
bufferPosition = 0;
bufferDataLength = 0;
break;
default: