Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Data XML Analysis > Connecting to A...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 494 of 568
Post > Topic >>

Connecting to Analysis Services with Java XML

by DY <nospam1@[EMAIL PROTECTED] > Feb 17, 2006 at 02:32 PM

I know this has been posted before but I cannot seem to find an answer to
my problem. Basically I am having trouble with the connection string in
"DataSourceInfo". I get the error:

XA:XMLAnalysisError.88BA0500
Unable to process the request, because the DataSourceInfo property was
missing or not correctly specified

I can get the VB sample to work no problem but for some reason I just
cannot get Java to work. I know I should not be using hard-coded
parameters but I am just trying to get it to work and they are the same I
am using in the VB example.

My Java code is:

im****t java.net.*;
im****t java.util.*;
im****t org.apache.soap.*;
im****t org.apache.soap.rpc.*;
im****t org.apache.soap.encoding.*;
im****t org.apache.soap.encoding.soapenc.*; im****t
org.apache.soap.util.xml.*;
im****t org.apache.soap.trans****t.http.*;

public class Client {

    public static void main( String[] args ) throws Exception {
        
        URL url = new URL("http://192.168.2.106/xmla/msxisapi.dll";
                
        SOAPMappingRegistry smr = new SOAPMappingRegistry();
        StringDeserializer sd = new StringDeserializer();
	smr.mapTypes(Constants.NS_URI_SOAP_ENC,
			new QName("","Result"), null, null, sd);

        SOAPHTTPConnection st = new SOAPHTTPConnection();

        Call call = new Call();
        call.setSOAPTrans****t(st);
        call.setSOAPMappingRegistry(smr);

        call.setTargetObjectURI
        ("urn:schemas-microsoft-com:xml-analysis");
        call.setMethodName("Discover");
       
call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");

        Vector params = new Vector();
        
        params.addElement(new Parameter("RequestType",String.class,
        					"MDSCHEMA_CUBES", null));

        params.addElement(new Parameter("Restrictions",String.class,
                "<RestrictionList>" +
                    "<DataSourceName>" +
                        "Local Analysis Server" +
                    "</DataSourceName>" +

                    "<CATALOG_NAME>" +
                        "FoodMart" +
                    "</CATALOG_NAME>" +
                "</RestrictionList>", null ));
                
        params.addElement(new Parameter("Properties",String.class,
                "<PropertyList>" +
                    "<DataSourceInfo>" +
                        "Data Source=server1;Provider=MSOLAP.2" +
                    "</DataSourceInfo>" +
                
                    "<Catalog>" +
                        "Foodmart" +
                    "</Catalog>" +
                "</PropertyList>", null ));
      
      
        call.setParams(params);
        call.buildEnvelope();

        System.out.println("Request="+call.toString()+"\n");

        Response resp = null;
        try {
            resp = call.invoke (url,
            	   "urn:schemas-microsoft-com:xml-analysis:Discover");
        }
        catch (SOAPException e) {
            System.err.println("Caught SOAPException(" + 
				e.getFaultCode() + "): " + 
				e.getMessage ());
	    return;
        }
        
        if (resp != null && !resp.generatedFault()) {
            Parameter ret = resp.getReturnValue();
	    Object value = ret.getValue();
            
            System.out.println("Answer="+value);
        }
        else {
            Fault fault = resp.getFault();
            System.out.println("Generated Fault:");
            System.out.println("Fault code = "+fault.getFaultCode());
            System.out.println("Fault string = "+fault.getFaultString());
        }
    }
}

Anyone any ideas?
 
Thanks.
 




 4 Posts in Topic:
Connecting to Analysis Services with Java XML
DY <nospam1@[EMAIL PRO  2006-02-17 14:32:35 
Re: Connecting to Analysis Services with Java XML
"Akshai Mirchandani   2006-02-17 11:34:30 
Re: Connecting to Analysis Services with Java XML
DY <nospam1@[EMAIL PRO  2006-02-20 12:48:40 
Re: Connecting to Analysis Services with Java XML
"Akshai Mirchandani   2006-02-20 10:57:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 10:03:23 CST 2008.