URGENT : DataSource Problem

HI,

My name is Paras Dhawan, I was looking for a code which can execute mdx queries through JAVA code using XML for Analysis and I found the following code at Microsoft Forum (click to see)

import java.net.*;

import java.util.*;

import org.apache.soap.*;

import org.apache.soap.rpc.*;

import org.apache.soap.encoding.*;

import org.apache.soap.encoding.soapenc.*;

import org.apache.soap.util.xml.*;

import org.apache.soap.transport.http.*;

public class Client {

public static void main( String[] args ) throws Exception {

URL url = new URL("http://localhost/xmla/msxisapi.dll");

SOAPMappingRegistry smr = new SOAPMappingRegistry();

StringDeserializer sd = new StringDeserializer();

smr.mapTypes(Constants.NS_URI_SOAP_ENC,

new QName("","Return"), null, null, sd);

SOAPHTTPConnection st = new SOAPHTTPConnection();

Call call = new Call();

call.setSOAPTransport(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>" +

"<CATALOG_NAME>Foodmart 2000</CATALOG_NAME>"+

"</RestrictionList>", null ));

params.addElement(new Parameter("Properties",String.class,

"<PropertyList>" +

"<DataSourceInfo>" +

"Provider=MSOLAP.2;Data Source=local" +

"</DataSourceInfo>" +

"<Catalog>" +

"Foodmart 2000" +

"</Catalog>" +

"<Format>Tabular</Format>"+

"<Content>SchemaData</Content>"+

"</PropertyList>", null ));

call.setParams(params);

call.buildEnvelope();

System.out.println("Body :"+call.getSOAPContext().toString());

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

Response resp = null;

try {

resp = call.invoke (url,

"urn:schemas-microsoft-com:xml-analysis:Discover");

// System.out.println("Envelope "+call.getEnvelopeString(call.getSOAPTransport()));

}

catch (SOAPException e) {

System.err.println("Caught SOAPException(" +

e.getFaultCode() + "): " +

e.getMessage ());

return;

}

System.out.println("resp:"+resp.toString());

if (resp != null && !resp.generatedFault()) {

Parameter ret = resp.getReturnValue();

Object value = ret.getValue();

System.out.println("value:"+value);

//for(int i=0;i<resp.getPartCount();i++){

//1 System.out.println("Answer="+resp.getBodyPart(i).getContent().toString());

//}

}

else {

Fault fault = resp.getFault();

System.out.println("Generated Fault:");

System.out.println("Fault code = "+fault.getFaultCode());

System.out.println("Fault string = "+fault.getFaultString());

}

}

}

Before executing this code I have installed

  • Microsoft SQL Server 2000
  • Analysis Services
  • Microsoft SQL Server 2000 Service Pack
  • XML for Analysis
  • XML Parser 4.0
  • IIS

I have followed all the instructions like I have created a virtual directory in IIS manager but IIS was not properly working on my system so I installed all the above things on my colleague’s system next to me and instead of writing http://localhost/xmla/msxisapi.dll in the code I wrote http://vikasjain/xmla/msxisapi.dll as “vikasjain” is the name of the system next to me, I am executing the code from my system through Eclipse IDE

But I am facing the following error

Generated Fault:

Fault code = XA:XMLAnalysisError.88BA0500

Fault string = Unable to process the request, because the DataSourceInfo property was missing or not correctly specified.

The DataSources.xml is as follows

<<DataSources UnnamedSessionsTimeout="300" NamedSessionsTimeout="3600" MaxRequestSize="128" AllowInsecureTransport="1" EnableNagleAlgorithm="1">

- <DataSource>

<DataSourceName>Local Analysis Server</DataSourceName>

<DataSourceDescription>Microsoft Analysis Server 2000 on local machine</DataSourceDescription>

<URL>http://localhost/xmla/msxisapi.dll</URL>

<DataSourceInfo>Provider=MSOLAP.2;Data Source=local</DataSourceInfo>

<ProviderName>Microsoft XML for Analysis</ProviderName>

- <ProviderType>

<TDP />

<MDP />

<DMP />

</ProviderType>

<AuthenticationMode>Unauthenticated</AuthenticationMode>

</DataSource>

- <<

I do not know that why it is showing this error when DataSources.xml has been properly defined… plz check the DataSources.xml and see whether it requires any change…. Or do I have to make a DSN on Vikas Jain’s system by name FoodMart of sqlserver

When I was trying to make the above DSN It was asking for database name, but the databases which it was showing were of Sql Server and the database “Food Mart 2000” of Analysis Server was missing how to do that…. Kindly solve me problem

I am only executing the code from system and rest everything is on vikasjain’s system. The name of Analysis Server running on vikasjain’s system is vikasjain…. Name of sqlserver running is also vikasjain….. sir plz tell me what is the mistake in the DataSourceInfo property… I have tried out each and everything but it is not working… Kindly solve my problem. Waiting 4 ur reply

Thanking You

Paras Dhawan

Software Engineer

Daffodil Software Limited , India




Answer this question

URGENT : DataSource Problem

  • Paintshow

    Hi,

    I am working in java with sql server 2005,

    can anyone help me to access the sql server 2005 analysis services from java,

    or just give me site or any other info


    Hope any one help

    Thanks & Regards,
    Santhakumar S.


  • wavemill

    Please see my reply to your later posting for a suggestion on DataSourceInfo property value.

  • URGENT : DataSource Problem