boolean create = false;
if( dialog == null )
dialog = ADialogBuilder.buildDialog( Form.class );
WsdlOperation operation = request.getOperation();
dialog.setValue( Form.STEP_NAME, operation.getName() );
dialog.setBooleanValue( Form.CLOSE_REQUEST, true );
dialog.setBooleanValue( Form.SHOW_TESTCASE, true );
dialog.setIntValue( Form.PORT, 8181 );
dialog.setValue( Form.PATH, "/" + operation.getName() );
SoapUIDesktop desktop = SoapUI.getDesktop();
dialog.getFormField( Form.CLOSE_REQUEST ).setEnabled( desktop != null && desktop.hasDesktopPanel( request ) );
if( !dialog.show() )
return false;
TestStepConfig config = WsdlMockResponseStepFactory.createConfig( operation, request, false );
MockResponseStepConfig mockResponseStepConfig = ( ( MockResponseStepConfig )config.getConfig() );
config.setName( dialog.getValue( Form.STEP_NAME ) );
mockResponseStepConfig.setPath( dialog.getValue( Form.PATH ) );
mockResponseStepConfig.setPort( dialog.getIntValue( Form.PORT, 8181 ) );
CompressedStringConfig responseContent = mockResponseStepConfig.getResponse().getResponseContent();
if( request.getResponse() == null && !request.getOperation().isOneWay() )
{
create = UISupport.confirm( "Request is missing response, create default mock response instead?", title );
}
if( create )
{
String response = operation.createResponse( operation.getSettings().getBoolean(
WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ) );
CompressedStringSupport.setString( responseContent, response );
}
else if( request.getResponse() != null )
{