Re: Connecting to Analysis Services with Java XML



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

  • error sending string with "http://" with soap lite
    ... Does anyone know how to send a web service request that contains the ... I have a web service in java with the method signature ... is going to receive a url instead of string. ...
    (comp.lang.perl.misc)
  • Re: jsp client for axis2 webservice
    ... Read the Java EE tutorial on the Sun web site. ... to call logic from a JSP. ... all the JSP does is POST an HTTP request to the application ... calling one of the stub methods that you have. ...
    (comp.lang.java.programmer)
  • making Lisp faster by giving it 40 more bits (was: Wasting Time)
    ... > My expectation was for larger values from waste-time. ... > is comparable to bignum assignment rather than to the bignum compare. ... > thread per request is the better model. ... If you try this in Java you will get an execution speed which is 50-80 ...
    (comp.lang.lisp)
  • Re: jsp client for axis2 webservice
    ... Read the Java EE tutorial on the Sun web site. ... It talks generally about how to call logic from a JSP. ... A servlet on the app server receives the request, parses out the request parameters, and passes them along to an instance of a regular Java class, usually a Bean. ... That object in turn will perform some processing, say, calling one of the stub methods that you have. ...
    (comp.lang.java.programmer)
  • Re: Servlet To Java Application Communication
    ... I would like to write a Java servlet that it will be able to ... way to communicate with a servlet. ... probably know you should encode the request XML in the body part of a POST ... and expect the response XML in the response content. ...
    (comp.lang.java.databases)