1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.rest.support.handlers;
14
15 import com.eviware.soapui.impl.rest.support.MediaTypeHandler;
16 import com.eviware.soapui.impl.wsdl.submit.transports.http.HttpResponse;
17 import com.eviware.soapui.support.xml.XmlUtils;
18
19 public class DefaultMediaTypeHandler implements MediaTypeHandler
20 {
21 public boolean canHandle( String contentType )
22 {
23 return true;
24 }
25
26 public String createXmlRepresentation( HttpResponse response )
27 {
28 String content = response.getContentAsString();
29 if( content == null || XmlUtils.seemsToBeXml( content ) )
30 return content;
31 else
32 return "<data><![CDATA[" + content + "]]></data>";
33 }
34 }