Previous Thread:   Connecting to Analysis Services using Java - the solution!

5/9/2006 11:09:01 PM    EndSession is throwing an error
I recently upgraded to SqlServer 2005 and VS .Net 2005.  I'm using XML for  
  
Analysis.  I used vs.wsdl to generate stubs using gSoap.  
  
I'm ab;e to send the begin session request and it worked successfully.  
  
When I try to end session, I get an error.  See the following begin session  
  
request, response, end session request and error;  
  
<?xml version="1.0" encoding="UTF-8"?>  
  
<SOAP-ENV:Envelope  
  
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
  
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
  
xmlns:v12x="urn:schemas-microsoft-com:xml-analysis"><SOAP-ENV:Header><v12x:BeginSession  
  
v12x:begin="true"></v12x:BeginSession></SOAP-ENV:Header><SOAP-ENV:Body><v12x:Discover><v12x:RequestType>DISCOVER_DATASOURCES</v12x:RequestType><v12x:Restrictions></v12x:Restrictions><v12x:Properties><v12x:PropertyList><v12x:DataSourceInfo>PROVIDER=MSOLAP.3;DATASOURCE=local;USER  
  
ID=sd;PASSWORD=sd</v12x:DataSourceInfo></v12x:PropertyList></v12x:Properties></v12x:Discover></SOAP-ENV:Body></SOAP-ENV:Envelope>  
  
//********** beginsession response  
  
HTTP/1.1 200 OK  
  
Connection: close  
  
Date: Wed, 10 May 2006 05:45:34 GMT  
  
Server: Microsoft-IIS/6.0  
  
MicrosoftOfficeWebServer: 5.0_Pub  
  
X-Powered-By: ASP.NET  
  
Content-Type: text/xml;charset="utf-8"  
  
<soap:Envelope  
  
xmlns:soap="<soap:Header><Session" class=keywordroll target=_blank>http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Session  
  
xmlns="urn:schemas-microsoft-com:xml-analysis"  
  
SessionId="C138852F-4931-43CE-AB20-0270F8CA5773"/></soap:Header><soap:Body><DiscoverResponse  
  
xmlns="urn:schemas-microsoft-com:xml-analysis"><return><root  
  
xmlns="urn:schemas-microsoft-com:xml-analysis:rowset"  
  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  
xmlns:xsd="<xsd:schema" class=keywordroll target=_blank>http://www.w3.org/2001/XMLSchema"><xsd:schema  
  
targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset"  
  
xmlns:sql="urn:schemas-microsoft-com:xml-sql"  
  
elementFormDefault="qualified"><xsd:element  
  
name="root"><xsd:complexType><xsd:sequence minOccurs="0"  
  
maxOccurs="unbounded"><xsd:element name="row"  
  
type="row"/></xsd:sequence></xsd:complexType></xsd:element><xsd:simpleType  
  
name="uuid"><xsd:restriction base="xsd:string"><xsd:pattern  
  
value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}"/></xsd:restriction></xsd:simpleType><xsd:complexType  
  
name="xmlDocument"><xsd:sequence><xsd:any/></xsd:sequence></xsd:complexType><xsd:complexType  
  
name="row"><xsd:sequence><xsd:element sql:field="DataSourceName"  
  
name="DataSourceName" type="xsd:string"/><xsd:element  
  
sql:field="DataSourceDescription" name="DataSourceDescription"  
  
type="xsd:string" minOccurs="0"/><xsd:element sql:field="URL" name="URL"  
  
type="xsd:string" minOccurs="0"/><xsd:element sql:field="DataSourceInfo"  
  
name="DataSourceInfo" type="xsd:string" minOccurs="0"/><xsd:element  
  
sql:field="ProviderName" name="ProviderName" type="xsd:string"/><xsd:element  
  
sql:field="ProviderType" name="ProviderType" type="xsd:string" minOccurs="0"  
  
maxOccurs="unbounded"/><xsd:element sql:field="AuthenticationMode"  
  
name="AuthenticationMode" type="xsd:string"  
  
minOccurs="0"/></xsd:sequence></xsd:complexType></xsd:schema><row><DataSourceName>V12</DataSourceName><DataSourceDescription/><URL/><DataSourceInfo/><ProviderName>Microsoft  
  
Analysis  
  
Services</ProviderName><ProviderType>MDP</ProviderType><ProviderType>TDP</ProviderType><ProviderType>DMP</ProviderType><AuthenticationMode>Authenticated</AuthenticationMode></row></root></return></DiscoverResponse></soap:Body></soap:Envelope>  
  
//***********end session reuest  
  
POST /xmla/msmdpump.dll HTTP/1.1  
  
Host: localhost  
  
User-Agent: gSOAP/2.7  
  
Content-Type: text/xml; charset=utf-8  
  
Content-Length: 803  
  
Connection: close  
  
Authorization: Basic c3FsdXNlcjphbGxvd21l  
  
SOAPAction: "urn:schemas-microsoft-com:xml-analysis:Discover"  
  
<?xml version="1.0" encoding="UTF-8"?>  
  
<SOAP-ENV:Envelope  
  
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
  
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
  
xmlns:v12x="urn:schemas-microsoft-com:xml-analysis"><SOAP-ENV:Header><v12x:EndSession  
  
v12x:SessionId="C138852F-4931-43CE-AB20-0270F8CA5773"></v12x:EndSession></SOAP-ENV:Header><SOAP-ENV:Body><v12x:Discover><v12x:RequestType>DISCOVER_DATASOURCES</v12x:RequestType><v12x:Restrictions></v12x:Restrictions><v12x:Properties><v12x:PropertyList><v12x:DataSourceInfo>PROVIDER=MSOLAP.3;DATASOURCE=local;USER  
  
ID=sd;PASSWORD=sd</v12x:DataSourceInfo></v12x:PropertyList></v12x:Properties></v12x:Discover></SOAP-ENV:Body></SOAP-ENV:Envelope>  
  
//*********** end session response/error  
  
HTTP/1.1 200 OK  
  
Connection: close  
  
Date: Wed, 10 May 2006 05:45:39 GMT  
  
Server: Microsoft-IIS/6.0  
  
MicrosoftOfficeWebServer: 5.0_Pub  
  
X-Powered-By: ASP.NET  
  
Content-Type: text/xml;charset="utf-8"  
  
<soap:Envelope  
  
xmlns:soap="<soap:Body><soap:Fault" class=keywordroll target=_blank>http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault  
  
xmlns="<faultcode>XMLAnalysisError.0xc10c000a</faultcode><faultstring>XML" class=keywordroll target=_blank>http://schemas.xmlsoap.org/soap/envelope/"><faultcode>XMLAnalysisError.0xc10c000a</faultcode><faultstring>XML  
  
for Analysis parser: The '' session ID cannot be found. Either the session  
  
does not exist or it has already expired.</faultstring><detail><Error  
  
ErrorCode="3238789130" Description="XML for Analysis parser: The '' session  
  
ID cannot be found. Either the session does not exist or it has already  
  
expired." Source="Microsoft SQL Server 2005 Analysis Services"  
  
HelpFile=""/></detail></soap:Fault></soap:Body></soap:Envelope>



5/10/2006 11:50:31 AM    Re: EndSession is throwing an error
Try to send the EndSession request without any actual action -- e.g. an  
  
empty Statement for an Execute request. Something like this:  
  
<SOAP-ENV:Envelope  
  
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
  
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
  
xmlns:v12x="urn:schemas-microsoft-com:xml-analysis">  
  
<SOAP-ENV:Header>  
  
<v12x:EndSession  
  
v12x:SessionId="C138852F-4931-43CE-AB20-0270F8CA5773">  
  
</v12x:EndSession>  
  
</SOAP-ENV:Header>  
  
<SOAP-ENV:Body>  
  
<v12x:Execute>  
  
<v12x:Command>  
  
<v12x:Statement/>  
  
</v12x:Command>  
  
<v12x:Properties><v12x:PropertyList>  
  
</v12x:PropertyList>  
  
</v12x:Properties>  
  
</v12x:Execute>  
  
</SOAP-ENV:Body>  
  
</SOAP-ENV:Envelope>  
  
HTH,  
  
Akshai  
  
--  
  
Try out the MSDN Forums for Analysis Services at:  
  
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=83&SiteID=1  
  
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.  
  
"Suman" <Suman@discussions.microsoft.com> wrote in message  
  
news:E2CA0CB3-62F0-47B3-AD8B-0BBEFC1EC316@microsoft.com...