There are two ways (I think) to overcome this: 1. Use public fields instead of get/set methods, which allows you to capitalize the first character. 2. Use a BeanInfo (I think).
I chose #1 intentionally, since it requires less typing ;). Scott ----- Original Message ----- From: "Yalavarthi, Vasu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, April 09, 2002 5:19 PM Subject: RE: Connecting to MS OLAP Server using Java-Soap Client > Hi Scott, > Thank you so much for u'r fact response. Sorry to bother u again and again. > > I mapped TRestrictionList and TPropertyList to BeanSerializer. > I also added the get/set methods to these classes. > when i call invoke, i'm getting the following exception (now the request is > not at all submitted)... > > /////////Exception///////////// > Caught SOAPException (SOAP-ENV:Client): Unable to retrieve 'restrictionList' > property value: null. > //////////End Exception////// > > Also, note the 'restrictionList' member name, i want to pass > 'RestrictionList'. By default, according to java beans spec, it takes the > first character as a lower case. How do i overcome this? > > Attached please find the java source file of this client class. > > Thanks, > Vasu > > > > > -----Original Message----- > From: Scott Nichol [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 12:44 PM > To: [EMAIL PROTECTED] > Subject: Re: Connecting to MS OLAP Server using Java-Soap Client > > > Sorry, my original message may not have been clear on this, but you must > also > map TRestrictionList and TPropertyList to the BeanSerializer. Basically, > any > class you want to serialize must be mapped. The only built-in mapping are > for > Java primitives (e.g. int), wrappers (e.g. Integer) and a few odds and ends > (e.g. Date, Hashtable, Vector). > > Scott > > ----- Original Message ----- > From: "Yalavarthi, Vasu" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, April 09, 2002 3:27 PM > Subject: RE: Connecting to MS OLAP Server using Java-Soap Client > > > > Hi Scott, > > I tried as u suggested. > > But now, it is not generating the expected request XML. It's omitting the > > child tags of "Restrictions" and "Properties" tags. > > Do u think it has got something to do with QName(nameSpaceURI, localPart)? > > > > Following is my java code (as suggested by u)... > > > > ////////// Start Java Code //////////////// > > URL url = new URL ("http://localhost/xmla/msxisapi.dll"); > > SOAPMappingRegistry smr = new SOAPMappingRegistry (); > > StringDeserializer sd = new StringDeserializer (); > > BeanSerializer beanSer = new BeanSerializer(); > > smr.mapTypes (Constants.NS_URI_SOAP_ENC, new QName ("", "Result"), > null, > > null, sd); > > smr.mapTypes (Constants.NS_URI_SOAP_ENC, new > > QName("urn:schemas-microsoft-com:xml-analysis", > > "Restrictions"), TRestrictions.class, beanSer, beanSer); > > smr.mapTypes (Constants.NS_URI_SOAP_ENC, new > > QName("urn:schemas-microsoft-com:xml-analysis", > > "Properties"), TProperties.class, beanSer, beanSer); > > > > // 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(); > > TRestrictions restrictions = new TRestrictions(); > > restrictions.RestrictionList.CATALOG_NAME = "FoodMart 2000"; > > > > TProperties properties = new TProperties(); > > properties.PropertyList.DataSourceInfo = "Provider=MSOLAP;Data > > Source=s152969;"; > > properties.PropertyList.Format = "Tabular"; > > properties.PropertyList.Catalog = "FoodMart 2000"; > > > > params.addElement(new Parameter("RequestType", String.class, > > "MDSCHEMA_CUBES", null)); > > params.addElement(new Parameter("Restrictions", TRestrictions.class, > > restrictions, null)); > > params.addElement(new Parameter("Properties", TProperties.class, > > properties, null)); > > > > call.setParams(params); > > ///////// End Java Code ///////////// > > > > The following is request XML as observed on TCPMonitor > > > > ////////////REQUEST XML /////////////// > > <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/1999/XMLSchema"> <SOAP-ENV:Body> > <ns1:Discover > > xmlns:ns1="urn:schemas-microsoft-com:xml-analysis" > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > > <RequestType xsi:type="xsd:string">MDSCHEMA_CUBES</RequestType> > > <Restrictions xmlns:ns2="" xsi:type="ns2:Restrictions"> </Restrictions> > > <Properties xsi:type="ns1:Properties"> </Properties> </ns1:Discover> > > </SOAP-ENV:Body> </SOAP-ENV:Envelope> > > ////////End XML/////////////// > > > > Can u tell me if i am missing something.... > > BTW, does it have something to do with WSDL? > > > > Thanks, > > Vasu > > > > > > -----Original Message----- > > From: Scott Nichol [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, April 09, 2002 6:24 AM > > To: [EMAIL PROTECTED] > > Subject: Re: Connecting to MS OLAP Server using Java-Soap Client > > > > > > 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 '<'. > > > > 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" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > 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 > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com