Re: Connecting to Analysis Services with Java XML



I said to change the "namespace" and not the content (you may also need to
change the content but that wasn't your initial problem). The namespace is
something like this:

<Properties xmlns="urn:schemas-microsoft-com:xml-analysis">
<PropertyList>
...
</Properties>

The xmlns specifies a namespace (sort of like a Java package). You need to
make sure that the element you add to your request has the correct
namespace.

Thanks,
Akshai

--
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.


"DY" <nospam1@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:pan.2006.02.20.12.48.36.565938@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for the reply but sadly no luck. I am actually a bit confused by
the various tags so I would be very grateful if you can confirm I have
done the right thing as follows:

I have changed datasource.xml to have the following entries and changed
the VB program to the same and it still works, so I know the changes are
OK.

datasources.xml:
...
<DataSourceName>XYZ</DataSourceName>
...
<DataSourceInfo>Provider=MSOLAP.2;Data Source=serversql</DataSourceInfo>
...

In the VB code, the relevent line seems to be:
m_strProperties = "<DataSourceInfo>" & DATASOURCE & "</DataSourceInfo>" _
...
so I changed:
Const DATASOURCE = "XYZ"

When I run the program, it reports that DataSourceName is XYZ
and DataSourceInfo is also XYZ. ???? (I am confused here)

So I have plugged the same values into my Java program but it still gives
the error. I have now got:

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

"<CATALOG_NAME>" +
"FoodMart" +
"</CATALOG_NAME>" +
"</RestrictionList>", null ));

params.addElement(new Parameter("Properties",String.class,
"<PropertyList>" +
"<DataSourceInfo>" +
"XYZ" +
"</DataSourceInfo>" +

"<Catalog>" +
"Foodmart" +
"</Catalog>" +
"</PropertyList>", null ));

I have also tried just changing <DataSourceName> to XYZ and leaving
<DataSourceInfo> as Provider=MSOLAP.2;Data Source=serversql but no luck.

Have I missed something? Is there a way of looking at the request stream
to IIS (another problem: there is no facility for looking at the IIS log
for some reason. I am no Windows expert so perhaps someone can tell me how
to do this and where does IIS keep the log file?? - Windows 2000)

Many thanks.




On Fri, 17 Feb 2006 11:34:30 -0800, Akshai Mirchandani [MS] wrote:

Most likely your <Properties> element isn't in the correct namespace.
Compare your Java request to the VB request and see the difference...

Thanks,
Akshai

--
--
This posting is provided "AS IS" with no warranties, and confers no
rights
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.


"DY" <nospam1@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:pan.2006.02.17.14.32.34.824590@xxxxxxxxxxxxxxxxxxxxxxx
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:

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://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.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>" +
"<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.



.



Relevant Pages

  • Re: Connecting to Analysis Services with Java XML
    ... it reports that DataSourceName is XYZ ... Compare your Java request to the VB request and see the difference... ... "DataSourceInfo". ...
    (microsoft.public.data.xmlanalysis)
  • Re: Hypothetical: All code in classes but main()
    ... the argument Stroustrup gives for having helper functions at namespace ... If a function requires access to member data, then by all means make it ... > There are advantages to having the static Math class in Java. ...
    (comp.lang.cpp)
  • Re: Understanding WebDAV XML Requests
    ... Since you are sending XML requests, ... namespace and put it in another one. ... Imagine two streets, with the same name (call it Chester ... You can either use this request: ...
    (microsoft.public.exchange2000.development)
  • Re: C# vs VB.Net
    ... CSC students code in java for most classes. ... C# puts in "namespace MyCompany.Technology.Args" for you. ... there is no simple way of telling the runtime not to serialize ... VB.NET has no within-the-line comment syntax ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Question of a Java programmer
    ... similar to packages, but there really *isn't* a concept like an assembly in Java. ... You *can* add metadata to a jar file saying that no other jar files are allowed to add to a namespace, ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast