private File buildConfig( File reportFile, File logFile, WsdlMockResponse modelItem ) throws IOException
{
Settings settings = modelItem.getSettings();
ConfigurationDocument configDoc = ConfigurationDocument.Factory.newInstance();
Configuration config = configDoc.addNewConfiguration();
config.setVerbose( settings.getBoolean( WSISettings.VERBOSE ) );
AssertionResults results = config.addNewAssertionResults();
results.setType( AssertionResults.Type.Enum.forString( settings.getString( WSISettings.RESULTS_TYPE,
AssertionResults.Type.ONLY_FAILED.toString() ) ) );
results.setMessageEntry( settings.getBoolean( WSISettings.MESSAGE_ENTRY ) );
results.setFailureMessage( settings.getBoolean( WSISettings.FAILURE_MESSAGE ) );
results.setAssertionDescription( settings.getBoolean( WSISettings.ASSERTION_DESCRIPTION ) );
ReportFile report = config.addNewReportFile();
report.setLocation( reportFile.getAbsolutePath() );
report.setReplace( true );
AddStyleSheet stylesheet = report.addNewAddStyleSheet();
stylesheet.setHref( ".\\..\\common\\Profiles\\SSBP10_BP11_TAD.xml" );
stylesheet.setType( "text/xsl" );
stylesheet.setAlternate( false );
config.setTestAssertionsFile( "../../common/profiles/SSBP10_BP11_TAD.xml" );
LogFile logFileConfig = config.addNewLogFile();
logFileConfig.setStringValue( logFile.getAbsolutePath() );
logFileConfig.setCorrelationType( CorrelationType.ENDPOINT );
/*
* WsdlInterface iface = (WsdlInterface)
* modelItem.getOperation().getInterface();
*
* WsdlReferenceConfig wsdlRef = config.addNewWsdlReference();
* wsdlRef.setWsdlURI( iface.getWsdlDefinition() );
* WsdlElementReferenceConfig wsdlElement = wsdlRef.addNewWsdlElement();
* wsdlElement.setType( WsdlElementTypeConfig.BINDING );
* wsdlElement.setStringValue( iface.getBindingName().getLocalPart() );
* wsdlElement.setNamespace( iface.getBindingName().getNamespaceURI() );
* wsdlRef.setServiceLocation( modelItem.getEndpoint() );
*/
configFile = configDoc.toString();
File file = File.createTempFile( "wsi-analyzer-config", ".xml" );
configDoc.save( file );
return file;
}