return file;
}
private void addMessageConfig( Log log, WsdlRequest modelItem ) throws MalformedURLException
{
HttpMessageEntry requestMessage = HttpMessageEntry.Factory.newInstance();
requestMessage.addNewMessageContent().setStringValue( modelItem.getRequestContent() );
requestMessage.setConversationID( "1" );
requestMessage.setTimestamp( Calendar.getInstance() );
requestMessage.setID( "1" );
URL endpoint = new URL( modelItem.getEndpoint() );
requestMessage.setSenderHostAndPort( "localhost" );
if( endpoint.getPort() > 0 )
requestMessage.setReceiverHostAndPort( endpoint.getHost() + ":" + endpoint.getPort() );
else
requestMessage.setReceiverHostAndPort( endpoint.getHost() );
requestMessage.setType( TcpMessageType.REQUEST );
Response response = modelItem.getResponse();
HttpMessageEntry responseMessage = HttpMessageEntry.Factory.newInstance();
responseMessage.addNewMessageContent().setStringValue( response.getContentAsString() );
responseMessage.setConversationID( "1" );
responseMessage.setType( TcpMessageType.RESPONSE );
responseMessage.setTimestamp( Calendar.getInstance() );
responseMessage.setID( "2" );
responseMessage.setSenderHostAndPort( requestMessage.getReceiverHostAndPort() );
responseMessage.setReceiverHostAndPort( requestMessage.getSenderHostAndPort() );
String requestHeaders = buildHttpHeadersString( response.getRequestHeaders() );
requestMessage.setHttpHeaders( "POST " + endpoint.getPath() + " HTTP/1.1\r\n" + requestHeaders );
responseMessage.setHttpHeaders( buildHttpHeadersString( response.getResponseHeaders() ) );
log.setMessageEntryArray( new MessageEntry[] { requestMessage, responseMessage } );
}