Write and deploy preprocess and postprocess DCN filters to Unwired Server.
When specifying filters, add a dcn_filter parameter to the base URL, and to the parameters specified in the DCN request section. The dcn_filter parameter specifies the fully qualified name of the filter class, which must be in a valid CLASSPATH location so Unwired Server can locate it using its fully qualified name.
dcn_request={"pkg"~“TestPackage", "messages"~[{"id"~"1","mbo"~"Department","op"~"~upsert", "cols"~{"DepartmentID"~"3333", "DepartmentName"~“My Department", "DepartmentHeadID"~"501"}}]}
The dcn_request is in a format that is specific to the back end. The filter class can preprocess to the JSON format expected by Unwired Server.
import java.util.Map; import com.onepage.fw.uwp.shared.uwp.UWPLogger; import com.sybase.sup.dcn.DCNFilter; public class CustomDCNFilter implements DCNFilter { String preprocess(String blobDCNRequest, Map<String,String> headers) { String result = blobDCNRequest.replace(‘~’,’:’); return result; } String postprocess(String jsonDCNResult, Map<String,String> responseHeaders) { String result = jsonDCNResult.replace(‘:’,’~’); return result; } public static void main( String[] args ) { } }