OPeNDAPClient oc = BesAPI.startClient(); BesAPI.configureTransaction(oc, rs.getDataset(), null);  ByteArrayOutputStream os = new ByteArrayOutputStream(); BesAPI.getDataProduct(oc, BesAPI.getAPINameForDDS(), os);  ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray()); ServerDDS dds = new ServerDDS(new DefaultFactory()); dds.parse(is);  os = new ByteArrayOutputStream(); BesAPI.getDataProduct(oc, BesAPI.getAPINameForDAS(), os);  BesAPI.shutdownClient(oc);  is = new ByteArrayInputStream(os.toByteArray()); DAS das = new DAS(); das.parse(is);
ServerDDS ddx = BesAPI.getDDX(rs.getDataset(), rs.getConstraintExpression()); DAS das = ddx.getDAS();
    public void sendHTMLRequestForm(HttpServletRequest request,                                    HttpServletResponse response,                                    ReqState rs)            throws Exception {        response.setContentType("text/html");        response.setHeader("XDODS-Server", getXDODSServerVersion());        response.setHeader("XOPeNDAP-Server", getXOPeNDAPServerVersion());        response.setHeader("XDAP", getXDAPVersion(request));        response.setHeader("Content-Description", "dods_form");        System.out.println("Sending OPeNDAP Data Request Form For: " + rs.getDataset() +                "    CE: '" + request.getQueryString() + "'");        OPeNDAPClient oc = BesAPI.startClient();        BesAPI.configureTransaction(oc, rs.getDataset(), null);        ByteArrayOutputStream os = new ByteArrayOutputStream();        BesAPI.getDataProduct(oc, BesAPI.getAPINameForDDS(), os);        ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());        ServerDDS dds = new ServerDDS(new DefaultFactory());        dds.parse(is);        os = new ByteArrayOutputStream();        BesAPI.getDataProduct(oc, BesAPI.getAPINameForDAS(), os);        BesAPI.shutdownClient(oc);        is = new ByteArrayInputStream(os.toByteArray());        DAS das = new DAS();        das.parse(is);/*        // Turn this on later if we discover we're supposed to accept        // constraint expressions as input to the Data Request Web Form        String ce;        if(request.getQueryString() == null){            ce = "";            }        else {            ce = "?" + request.getQueryString();            }*/        PrintWriter pw = new PrintWriter(response.getOutputStream());        DefaultResponse.sendHtmlResponse(pw, rs, dds, das);        response.setStatus(HttpServletResponse.SC_OK);    }