diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java index 6e0d01ef95e..a505c827ad5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/ResourceMethod.java @@ -36,8 +36,8 @@ public class ResourceMethod { this.resourceType = resourceType; } - public IResource getResourceType() throws IllegalAccessException, InstantiationException { - return (IResource)resourceType.newInstance(); + public Class getResourceType() throws IllegalAccessException, InstantiationException { + return resourceType.getClass(); } public RequestType getRequestType() { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java index 9f358bfb297..2fba28550c5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/ws/Service.java @@ -165,7 +165,7 @@ public class Service extends HttpServlet { ResourceMethod resourceMethod = resource.getMethod(params.keySet()); if (null == resourceMethod) throw new MethodNotFoundException("No resource method available for the supplied parameters " + params); - FhirContext ctx = new FhirContext(resourceMethod.getResourceType().getClass()); + FhirContext ctx = new FhirContext(resourceMethod.getResourceType()); XmlParser p = new XmlParser(ctx); response.getWriter().write(p.encodeResourceToString(resourceMethod.invoke(params))); } catch (Throwable t) {