Some REST services have been fixed to return the response in XML format by default.
https://fedorahosted.org/pki/ticket/1276 Pushed under one-liner/trivial rule. -- Endi S. Dewata
>From efdb234b2694ad5f97dcc71842116f9cb57fe9f8 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" <edew...@redhat.com> Date: Tue, 14 Jun 2016 20:22:36 +0200 Subject: [PATCH] Fixed REST response format. Some REST services have been fixed to return the response in XML format by default. https://fedorahosted.org/pki/ticket/1276 --- base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java | 4 ++-- base/server/cms/src/org/dogtagpki/server/rest/FeatureService.java | 2 +- base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java b/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java index 0993b5c0d8a831f942720f4e1acf67f59da58fda..5ecabacd9a84a4d06e529ca0099f561155f7d791 100644 --- a/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java +++ b/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java @@ -46,8 +46,8 @@ import com.netscape.certsrv.base.PKIException; import com.netscape.certsrv.base.ResourceNotFoundException; import com.netscape.certsrv.base.ServiceUnavailableException; import com.netscape.certsrv.ca.AuthorityID; -import com.netscape.certsrv.ca.CAEnabledException; import com.netscape.certsrv.ca.CADisabledException; +import com.netscape.certsrv.ca.CAEnabledException; import com.netscape.certsrv.ca.CAMissingCertException; import com.netscape.certsrv.ca.CAMissingKeyException; import com.netscape.certsrv.ca.CANotFoundException; @@ -97,7 +97,7 @@ public class AuthorityService extends PKIService implements AuthorityResource { GenericEntity<List<AuthorityData>> entity = new GenericEntity<List<AuthorityData>>(results) {}; - return Response.ok(entity).build(); + return createOKResponse(entity); } @Override diff --git a/base/server/cms/src/org/dogtagpki/server/rest/FeatureService.java b/base/server/cms/src/org/dogtagpki/server/rest/FeatureService.java index df0ea53444682efc751e2faf7cf1d87b17b32395..8c85437bbeaa1365faffd866f978460381d9cde8 100644 --- a/base/server/cms/src/org/dogtagpki/server/rest/FeatureService.java +++ b/base/server/cms/src/org/dogtagpki/server/rest/FeatureService.java @@ -31,7 +31,7 @@ public class FeatureService extends PKIService implements FeatureResource { features.add(feature); } GenericEntity<List<Feature>> entity = new GenericEntity<List<Feature>>(features) {}; - return Response.ok(entity).build(); + return createOKResponse(entity); } @Override diff --git a/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java b/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java index b0b4fd229a322e2ecbb959314ad737023a883745..9e1caaa86bea83d1f57a1c9150dcfae0898b6d38 100644 --- a/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java +++ b/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java @@ -132,9 +132,7 @@ public class ConfigService extends PKIService implements ConfigResource { auditConfigTokenGeneral(ILogger.SUCCESS, method, newProperties, null); - return Response - .ok(configData) - .build(); + return createOKResponse(configData); } catch (PKIException e) { CMS.debug(method +": " + e); -- 2.5.5
_______________________________________________ Pki-devel mailing list Pki-devel@redhat.com https://www.redhat.com/mailman/listinfo/pki-devel