{
WsdlTestRequestStep test = ( WsdlTestRequestStep )testCase.insertTestStep(
WsdlTestRequestStepFactory.createConfig( me.getOperation(), "Monitor Request " + ( row + 1 ) ),
-1 );
WsdlTestRequest request = test.getTestRequest();
request.setRequestContent( me.getRequestContent() );
request.setEndpoint( me.getTargetUrl().toString() );
request.setIncomingWss( incomingRequestWss );
Attachment[] requestAttachments = me.getRequestAttachments();
if( requestAttachments != null )
{
for( Attachment attachment : requestAttachments )
{
request.importAttachment( attachment );
}
}
}
else
{
// if( me.getResponseContentType().contains( "/x-amf" ) )
// {
// AMFRequestStepFactory httpRequestStepFactory = new
// AMFRequestStepFactory();
// AMFRequestTestStep test = ( AMFRequestTestStep
// )testCase.insertTestStep( httpRequestStepFactory
// .createConfig( me, "Monitor Request " + ( row + 1 ) ), -1
// );
//
// AMFRequest request = test.getAMFRequest();
// // request.setRequestContent( me.getRequestContent() );
// request.setEndpoint( me.getTargetUrl().toString() );
// request.setHttpHeaders( me.getRequestHeaders() );
//
// }
// else
// {
HttpRequestStepFactory httpRequestStepFactory = new HttpRequestStepFactory();
HttpTestRequestStep test = ( HttpTestRequestStep )testCase.insertTestStep(
httpRequestStepFactory.createConfig( me, "Monitor Request " + ( row + 1 ) ), -1 );
test.getTestRequest().setRequestHeaders( excludeHeaders( me.getRequestHeaders() ) );
HttpTestRequest request = ( HttpTestRequest )test.getHttpRequest();
request.setEndpoint( me.getTargetUrl().toString() );
// request.setIncomingWss( incomingRequestWss );
String existingMediaType = me.getResponseHeaders().get( "Content-Type", "" );
if( !StringUtils.isNullOrEmpty( existingMediaType ) )
{
request.setMediaType( existingMediaType );
}
if( "application/octet-stream".equals( existingMediaType )
|| "application/x-amf".equals( existingMediaType ) )
{
request.attachBinaryData( me.getRequestContent().getBytes(), existingMediaType );
}
else
{
request.setRequestContent( me.getRequestContent() );
test.getTestRequest().setRequestContent( me.getRequestContent() );
}
Attachment[] requestAttachments = me.getRequestAttachments();
if( requestAttachments != null )
{
for( Attachment attachment : requestAttachments )
{
request.importAttachment( attachment );
}
}
// }
}