Transformation of Custom Content Types and Encodings

Overview

By default, transformation is enabled for HTTP requests and responses that have the HTTP header Content-Type or Content-Encoding set to the following values:
  • Flex/AMF3 (Adobe, BlazeDS, GraniteDS): Content-Type set to "application/x-amf"
  • Java over HTTP: Content-Type set to "application/octet-stream" or "application/x-java-serialized-object"
  • Microsoft Silverlight: Content-Type set to "application/soap+msbin1" or "application/msbin1"
  • GZIP POST Data: Content-Encoding set to gzip

If you need to transform data with a different HTTP Content-Type or Content-Encoding header, this can be customized in the profile settings under Settings > Active Profile > Web (Protocol Level) > Transformation in the Additional Parameters field.

Enabling Custom Transformation During Replay

  1. Select Settings > Active Profile > Web (Protocol Level) > Transformation.
  2. In the Additional Parameters field, type AdditionalContentTypes=application/<myApp1>;application/<myApp2>. myApp1 and myApp1 are the custom content types of the application under test.

Enabling Custom Transformation During Recording

Note: These steps are not required for Content-Encoding customization.
  1. Select Settings > Active Profile > Web (Protocol Level) > Transformation.
  2. In the Additional Parameters field, type AdditionalContentTypes=application/<myApp1>;application/<myApp2>. myApp1 and myApp1 are the custom Content-Types of your application under test.
  3. Open the Documents folder in your current project directory with a file explorer (<my documents>\Silk Performer 20.0\Projects\<current project>\Documents).
  4. If this folder contains recording rule files (xrl), open them with a text editor.
  5. Search the recording rule files for Content-Type and duplicate any existing entries with your custom Content-Type. Example:
    <CompareData>
      <ApplyTo>Http.Final.Response.Header.Content-Type</ApplyTo>
      <Data>application/x-amf</Data>
    </CompareData>	
    
    <Or>
      <CompareData>
        <ApplyTo>Http.Final.Response.Header.Content-Type</ApplyTo>
        <Data>application/x-amf</Data>
      </CompareData>
      <CompareData>
        <ApplyTo>Http.Final.Response.Header.Content-Type</ApplyTo>
        <Data>application/myApp1</Data>
      </CompareData>
      <CompareData>
        <ApplyTo>Http.Final.Response.Header.Content-Type</ApplyTo>
        <Data>application/myApp2</Data>
      </CompareData>
    </Or>
    Note: If the <CompareData> elements are not encapsulated with an <Or> element you need to add this.