Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * This program is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License, version 2 as published by the Free Software
 * Foundation.
 *
 * You should have received a copy of the GNU General Public License along with this
 * program; if not, you can obtain a copy at http://www.gnu.org/licenses/gpl-2.0.html
 * or from the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 *
 * Copyright 2006 - 2017 Hitachi Vantara.  All rights reserved.
 */

public class Main {
    /**
     * Generates a discover request.
     * 
     * @param requestType request type
     * @return XMLA request
     */
    public static String generateXmlaDiscoverRequest(String requestType) {
        final StringBuilder buf = new StringBuilder();
        buf.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n").append("<SOAP-ENV:Envelope\n")
                .append(" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n")
                .append(" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n")
                .append(" <SOAP-ENV:Body>\n")
                .append("  <Discover xmlns=\"urn:schemas-microsoft-com:xml-analysis\"\n")
                .append("   SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n")
                .append("   <RequestType>").append(requestType).append("</RequestType>\n")
                .append("   <Restrictions>\n").append("    <RestrictionList/>\n").append("   </Restrictions>\n")
                .append("   <Properties>\n").append("    <PropertyList/>\n").append("   </Properties>\n")
                .append("  </Discover>\n").append(" </SOAP-ENV:Body>\n").append("</SOAP-ENV:Envelope>");
        return buf.toString();
    }
}