/** * INTERNAL: * Exception when processing DBWS metadata and the descriptor cannot be located for the operation */ public static DBWSException resultDoesNotExistForOperation(String resultType, String operation) { Object[] args = { resultType, operation }; DBWSException exception = new DBWSException(ExceptionMessageGenerator.buildMessage( DBWSException.class, RESULT_DOES_NOT_EXIST_FOR_OPERATION, args)); exception.setErrorCode(RESULT_DOES_NOT_EXIST_FOR_OPERATION); return exception; }
if (descriptor != null) { if (!xrService.getORSession().getProject().getAliasDescriptors().containsKey(descriptor)) { throw DBWSException.couldNotLocateDescriptorForOperation(descriptor, getName()); throw DBWSException.couldNotLocateQueryForDescriptor(name, descriptor); throw DBWSException.couldNotLocateQueryForSession(name,xrService.getORSession().getName());
throw DBWSException.couldNotLocateFile(DBWS_SESSIONS_XML); String orSessionKey = xrService.name + DASH_STR + DBWS_OR_SESSION_NAME_SUFFIX; if (!sessions.containsKey(orSessionKey)) { throw DBWSException.couldNotLocateORSessionForService(xrService.name); throw DBWSException.couldNotLocateOXSessionForService(xrService.name);
oxProject.setName(xrService.getName().concat(OX_PRJ_SUFFIX)); } catch (JAXBException e) { throw new DBWSException(OXM_PROCESSING_EX, e);
throw DBWSException.multipleOutputArgumentsOnlySupportedForSimpleXML(); throw DBWSException.inoutCursorArgumentsNotSupported();
protected InputStream initXRServiceStream(ClassLoader parentClassLoader, @SuppressWarnings("unused") ServletContext sc) { InputStream xrServiceStream = null; for (String searchPath : META_INF_PATHS) { String path = searchPath + DBWS_SERVICE_XML; xrServiceStream = parentClassLoader.getResourceAsStream(path); if (xrServiceStream != null) { break; } } if (xrServiceStream == null) { throw new WebServiceException(DBWSException.couldNotLocateFile(DBWS_SERVICE_XML)); } return xrServiceStream; }
@Override public void validate(XRServiceAdapter xrService) { super.validate(xrService); if (descriptorName == null) { throw DBWSException.couldNotLocateDescriptorForOperation(descriptorName, getName()); } if (!xrService.getORSession().getProject().getAliasDescriptors().containsKey(descriptorName)) { throw DBWSException.couldNotLocateDescriptorForOperation(descriptorName, getName()); } classDescriptor = xrService.getORSession().getProject().getDescriptorForAlias(descriptorName); }
throw DBWSException.couldNotLocateQueryForSession(name, xrService.getORSession().getName());
throw new WebServiceException(DBWSException.couldNotParseDBWSFile());
if (descriptor != null) { if (!xrService.getORSession().getProject().getAliasDescriptors().containsKey(descriptor)) { throw DBWSException.couldNotLocateDescriptorForOperation(descriptor, getName()); throw DBWSException.couldNotLocateQueryForDescriptor(name, descriptor); throw DBWSException.couldNotLocateQueryForSession(name,xrService.getORSession().getName());
throw DBWSException.couldNotLocateFile(DBWS_SESSIONS_XML); String orSessionKey = xrService.name + DASH_STR + DBWS_OR_SESSION_NAME_SUFFIX; if (!sessions.containsKey(orSessionKey)) { throw DBWSException.couldNotLocateORSessionForService(xrService.name); throw DBWSException.couldNotLocateOXSessionForService(xrService.name);
oxProject.setName(xrService.getName().concat(OX_PRJ_SUFFIX)); } catch (JAXBException e) { throw new DBWSException(OXM_PROCESSING_EX, e);
throw DBWSException.multipleOutputArgumentsOnlySupportedForSimpleXML(); throw DBWSException.inoutCursorArgumentsNotSupported();
protected InputStream initXRSchemaStream(ClassLoader parentClassLoader, ServletContext sc) { InputStream xrSchemaStream = null; String path = WSDL_DIR + DBWS_SCHEMA_XML; if (sc != null) { path = "/" + WEB_INF_DIR + path; xrSchemaStream = sc.getResourceAsStream(path); } else { // if ServletContext is null, then we are running in JavaSE6 'container-less' mode xrSchemaStream = parentClassLoader.getResourceAsStream(path); } if (xrSchemaStream == null) { throw new WebServiceException(DBWSException.couldNotLocateFile(DBWS_SCHEMA_XML)); } return xrSchemaStream; }
@Override public void validate(XRServiceAdapter xrService) { super.validate(xrService); if (descriptorName == null) { throw DBWSException.couldNotLocateDescriptorForOperation(descriptorName, getName()); } if (!xrService.getORSession().getProject().getAliasDescriptors().containsKey(descriptorName)) { throw DBWSException.couldNotLocateDescriptorForOperation(descriptorName, getName()); } classDescriptor = xrService.getORSession().getProject().getDescriptorForAlias(descriptorName); }
throw DBWSException.couldNotLocateQueryForSession(name, xrService.getORSession().getName());
throw new WebServiceException(DBWSException.couldNotParseDBWSFile());
/** * INTERNAL: * Exception when reading DBWS metadata and the given file cannot be located */ public static DBWSException couldNotLocateORSessionForService(String serviceName) { Object[] args = { serviceName }; DBWSException exception = new DBWSException(ExceptionMessageGenerator.buildMessage( DBWSException.class, COULD_NOT_LOCATE_OR_SESSION_FOR_SERVICE, args)); exception.setErrorCode(COULD_NOT_LOCATE_OR_SESSION_FOR_SERVICE); return exception; }
/** * <p>INTERNAL: * Read and unmarshal <code>XRService</code>'s <tt>.xsd</tt> file. * @param xrSchemaStream Stream resource for the <code>XRService</code>'s <tt>.xsd</tt> file. */ public void loadXMLSchema(InputStream xrSchemaStream) { SchemaModelProject schemaProject = new SchemaModelProject(); XMLContext xmlContext = new XMLContext(schemaProject); XMLUnmarshaller unmarshaller = xmlContext.createUnmarshaller(); Schema schema; try { schema = (Schema)unmarshaller.unmarshal(xrSchemaStream); } catch (XMLMarshalException e) { xmlContext.getSession().getSessionLog().log( SessionLog.WARNING, SessionLog.DBWS, "dbws_xml_schema_read_error", e.getLocalizedMessage()); throw new DBWSException(OXM_PROCESSING_SCH, e); } NamespaceResolver nr = schema.getNamespaceResolver(); String targetNamespace = schema.getTargetNamespace(); nr.put(TARGET_NAMESPACE_PREFIX, targetNamespace); xrService.schema = schema; xrService.schemaNamespace = targetNamespace; }
protected InputStream initXRSchemaStream(ClassLoader parentClassLoader, ServletContext sc) { InputStream xrSchemaStream = null; String path = WSDL_DIR + DBWS_SCHEMA_XML; if (sc != null) { path = "/" + WEB_INF_DIR + path; xrSchemaStream = sc.getResourceAsStream(path); } else { // if ServletContext is null, then we are running in JavaSE6 'container-less' mode xrSchemaStream = parentClassLoader.getResourceAsStream(path); } if (xrSchemaStream == null) { throw new WebServiceException(DBWSException.couldNotLocateFile(DBWS_SCHEMA_XML)); } return xrSchemaStream; }