0

I maintain a library that provides XML/A access trhough javascript: https://github.com/rpbouman/xmla4js

Mostly it works ok, but I would like to improve handling of error responses. As far as I understand the XML/A spec corectly, error responses take this form:

<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
  <faultcode>...</faultcode>
  <faultstring>...</faultstring>
  <faultactor>...</faultactor>
  <detail>
     ...
  </detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However, I found that at least for Mondrian (the XML/A provider I am most familiar with) the <detail> element often contains invaluable information. For instance, the general <faultcode> element may say something generic like "datasource not found" whereas the <detail> element may contain something like:

    <XA:error xmlns:XA="http://mondrian.sourceforge.net">
      <code>00HSBC01</code>
      <desc>The Mondrian XML: MondrianOneToOneUserRoleListMapper.ERROR_001_ - Access is denied because the roles of this user don&#39;t correspond to any present in the Mondrian schema requested.</desc>
    </XA:error>

Which indicates a rather more specific condition.

My question is, is there some kind of pattern in the error response of other XML/A providers that I can use to impove my api and provide better error messages to the users of my library? If you don't know about a patter but can only provide samples of XML/A providers you happen to have access to than that is also greatly appreciated. Thank you!

Roland Bouman
  • 31,125
  • 6
  • 66
  • 67

1 Answers1

0

You can download the Microsoft specification of the XMLA protocol here: http://msdn.microsoft.com/en-us/library/ee320606.aspx (more than seven hundred pages).

In general, there are two types of errors:

  • Global ones, that either prevent the request from being executed, or prevent the server from returning anything useful (e. g. syntax errors),
  • and local ones, e. g. within a single cell of a response to an MDX SELECT request where the general result structure is returned. In this case error objects may be returned e. g. in one or several cells instead of the result. An example would be an error an prevents the server from calculating this specific cell value, like a reference to an unknown element in the definition of a calculated member.
FrankPl
  • 13,205
  • 2
  • 14
  • 40
  • Thanks for the reply! But that spec is MSAS, not XML/A. The XML/A spec (http://msdn.microsoft.com/en-us/library/ms977626.aspx) is only a handful of pages, and the only explicit info I got from it re. errors is here: http://msdn.microsoft.com/en-us/library/ms977626.aspx#xmlanalysis_topic9 I found that mostly, the really interesting information is inside the tag, and the format for that seems to be vendor dependent. My question is to get samples for that tag so I can at least catch the most common issues. – Roland Bouman Feb 19 '14 at 18:05
  • The referenced document describes the Microsoft implementation of XML/A, including their specifics of the error return codes. If you look e. g. into section 2.2.4.1.1.3 for the `CellData` element, you can see that it can contain an optional `Error` element, which contains optional `ErrorCode` and `Description` elements. – FrankPl Feb 19 '14 at 18:18
  • @FrankPI: thanks! sorry, Indeed I didn't notice that that was in the MSAS spec. Thanks! This will at least help me to get decent handling of MSAS, which makes a huge difference. – Roland Bouman Feb 19 '14 at 18:34