You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by "Yalavarthi, Vasu" <vy...@informatica.com> on 2002/04/09 08:41:52 UTC

Connecting to MS OLAP Server using Java-Soap Client

Hi, 
My Java-Apache Soap client is trying to connect to Microsoft OLAP 
Server 2000(Provider) using their XML for Analysis 
(<http://msdn.microsoft.com/library/default.asp?> 
URL=/library/techart/xmlanalysis.htm). 

The Provider is returning the following fault code... 

//////////////////////////////// 
Generated fault: 
Fault Code = XMLAnalysisError.88BA0500 
Fault String = Unable to process the request, because the 
DataSourceInfo property was missing or not correctly specifie 
d. 
///////////////// 

The required Input (as per Microsoft is).... 

//////////////REQUEST//////////////// 
<SOAP-ENV:Envelope xmlns:SOAP- 
ENV="<http://schemas.xmlsoap.org/soap/envelope/>" 
xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" 
xmlns:xsd="<http://www.w3.org/2001/XMLSchema>"> 
<SOAP-ENV:Body> 
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis" SOAP- 
ENV:encodingStyle="<http://schemas.xmlsoap.org/soap/encoding/>"> 
<RequestType>MDSCHEMA_CUBES</RequestType> 
<Restrictions> 
<RestrictionList> 
<CATALOG_NAME>FoodMart 2000</CATALOG_NAME> 
</RestrictionList> 
</Restrictions> 
<Properties> 
<PropertyList> 
<DataSourceInfo>Provider=MSOLAP;Data 
Source=s152969</DataSourceInfo> 
<Format>Tabular</Format> 
<Catalog>FoodMart 2000</Catalog> 
</PropertyList> 
</Properties> 
</Discover> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 
///////////////// End Request /////////// 



The following is my java client code......... 

/////////////JAVA client code //////////// 
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 
("", "Result"), null, null, sd); 

// create the transport and set parameters 
SOAPHTTPConnection st = new SOAPHTTPConnection(); 

// build the call. 
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>Data 
Source=s152969;Provider=msolap;</DataSourceInfo><Catalog>Foodmart 
2000</Catalog></PropertyList>", null )); 

call.setParams(params); 

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; 
} 
//////////////////////End Client Code //////////////// 

Any help from gurus on this interoperability...? 

Thanks in advance, 
Vasu 

   

Re: Connecting to MS OLAP Server using Java-Soap Client

Posted by Scott Nichol <sc...@yahoo.com>.
Your attempt to send XML as a string parameter will not work.  The XML in the
string will be "escaped", e.g. the '<' will be converted to '&lt;'.

A simple way to get the correct format is to create Java beans for the parameter
data and map the class to the BeanSerializer.  For example,

class TRestrictionList {
    public String CATALOG_NAME;
}

class TRestrictions {
    public TRestrictionList RestrictionList;
}

class TPropertyList {
    public String DataSourceInfo;
    public String Format;
    public String Catalog;
}

class TProperties {
    public TPropertyList PropertyList;
}

...
BeanSerializer beanSer = new BeanSerializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC,    // maybe leave out the namespace in
QName?
             new QName("urn:schemas-microsoft-com:xml-analysis",
"Restrictions"),
             TRestrictions.class, beanSer, beanSer);
...
TRestrictions restrictions = new TRestrictions();
restrictions.RestrictionList.CATALOG_NAME = "FoodMart 2000";
params.addElement(new Parameter("Restrictions", Restrictions.class,
restrictions, null));

Scott

----- Original Message -----
From: "Yalavarthi, Vasu" <vy...@informatica.com>
To: <so...@xml.apache.org>
Sent: Tuesday, April 09, 2002 2:41 AM
Subject: Connecting to MS OLAP Server using Java-Soap Client


> Hi,
> My Java-Apache Soap client is trying to connect to Microsoft OLAP
> Server 2000(Provider) using their XML for Analysis
> (<http://msdn.microsoft.com/library/default.asp?>
> URL=/library/techart/xmlanalysis.htm).
>
> The Provider is returning the following fault code...
>
> ////////////////////////////////
> Generated fault:
> Fault Code = XMLAnalysisError.88BA0500
> Fault String = Unable to process the request, because the
> DataSourceInfo property was missing or not correctly specifie
> d.
> /////////////////
>
> The required Input (as per Microsoft is)....
>
> //////////////REQUEST////////////////
> <SOAP-ENV:Envelope xmlns:SOAP-
> ENV="<http://schemas.xmlsoap.org/soap/envelope/>"
> xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>"
> xmlns:xsd="<http://www.w3.org/2001/XMLSchema>">
> <SOAP-ENV:Body>
> <Discover xmlns="urn:schemas-microsoft-com:xml-analysis" SOAP-
> ENV:encodingStyle="<http://schemas.xmlsoap.org/soap/encoding/>">
> <RequestType>MDSCHEMA_CUBES</RequestType>
> <Restrictions>
> <RestrictionList>
> <CATALOG_NAME>FoodMart 2000</CATALOG_NAME>
> </RestrictionList>
> </Restrictions>
> <Properties>
> <PropertyList>
> <DataSourceInfo>Provider=MSOLAP;Data
> Source=s152969</DataSourceInfo>
> <Format>Tabular</Format>
> <Catalog>FoodMart 2000</Catalog>
> </PropertyList>
> </Properties>
> </Discover>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> ///////////////// End Request ///////////
>
>
>
> The following is my java client code.........
>
> /////////////JAVA client code ////////////
> 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
> ("", "Result"), null, null, sd);
>
> // create the transport and set parameters
> SOAPHTTPConnection st = new SOAPHTTPConnection();
>
> // build the call.
> 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>Data
> Source=s152969;Provider=msolap;</DataSourceInfo><Catalog>Foodmart
> 2000</Catalog></PropertyList>", null ));
>
> call.setParams(params);
>
> 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;
> }
> //////////////////////End Client Code ////////////////
>
> Any help from gurus on this interoperability...?
>
> Thanks in advance,
> Vasu
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: Connecting to MS OLAP Server using Java-Soap Client

Posted by Scott Nichol <sc...@yahoo.com>.
Your attempt to send XML as a string parameter will not work.  The XML in the
string will be "escaped", e.g. the '<' will be converted to '&lt;'.

A simple way to get the correct format is to create Java beans for the parameter
data and map the class to the BeanSerializer.  For example,

class TRestrictionList {
    public String CATALOG_NAME;
}

class TRestrictions {
    public TRestrictionList RestrictionList;
}

class TPropertyList {
    public String DataSourceInfo;
    public String Format;
    public String Catalog;
}

class TProperties {
    public TPropertyList PropertyList;
}

...
BeanSerializer beanSer = new BeanSerializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC,    // maybe leave out the namespace in
QName?
             new QName("urn:schemas-microsoft-com:xml-analysis",
"Restrictions"),
             TRestrictions.class, beanSer, beanSer);
...
TRestrictions restrictions = new TRestrictions();
restrictions.RestrictionList.CATALOG_NAME = "FoodMart 2000";
params.addElement(new Parameter("Restrictions", Restrictions.class,
restrictions, null));

Scott

----- Original Message -----
From: "Yalavarthi, Vasu" <vy...@informatica.com>
To: <so...@xml.apache.org>
Sent: Tuesday, April 09, 2002 2:41 AM
Subject: Connecting to MS OLAP Server using Java-Soap Client


> Hi,
> My Java-Apache Soap client is trying to connect to Microsoft OLAP
> Server 2000(Provider) using their XML for Analysis
> (<http://msdn.microsoft.com/library/default.asp?>
> URL=/library/techart/xmlanalysis.htm).
>
> The Provider is returning the following fault code...
>
> ////////////////////////////////
> Generated fault:
> Fault Code = XMLAnalysisError.88BA0500
> Fault String = Unable to process the request, because the
> DataSourceInfo property was missing or not correctly specifie
> d.
> /////////////////
>
> The required Input (as per Microsoft is)....
>
> //////////////REQUEST////////////////
> <SOAP-ENV:Envelope xmlns:SOAP-
> ENV="<http://schemas.xmlsoap.org/soap/envelope/>"
> xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>"
> xmlns:xsd="<http://www.w3.org/2001/XMLSchema>">
> <SOAP-ENV:Body>
> <Discover xmlns="urn:schemas-microsoft-com:xml-analysis" SOAP-
> ENV:encodingStyle="<http://schemas.xmlsoap.org/soap/encoding/>">
> <RequestType>MDSCHEMA_CUBES</RequestType>
> <Restrictions>
> <RestrictionList>
> <CATALOG_NAME>FoodMart 2000</CATALOG_NAME>
> </RestrictionList>
> </Restrictions>
> <Properties>
> <PropertyList>
> <DataSourceInfo>Provider=MSOLAP;Data
> Source=s152969</DataSourceInfo>
> <Format>Tabular</Format>
> <Catalog>FoodMart 2000</Catalog>
> </PropertyList>
> </Properties>
> </Discover>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> ///////////////// End Request ///////////
>
>
>
> The following is my java client code.........
>
> /////////////JAVA client code ////////////
> 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
> ("", "Result"), null, null, sd);
>
> // create the transport and set parameters
> SOAPHTTPConnection st = new SOAPHTTPConnection();
>
> // build the call.
> 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>Data
> Source=s152969;Provider=msolap;</DataSourceInfo><Catalog>Foodmart
> 2000</Catalog></PropertyList>", null ));
>
> call.setParams(params);
>
> 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;
> }
> //////////////////////End Client Code ////////////////
>
> Any help from gurus on this interoperability...?
>
> Thanks in advance,
> Vasu
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com