Friday, June 22, 2012

WebException Objects and XBRL Schema Object Creation

The other day, I was doing some performance testing in Gepsio and noticed that HTTP errors found during the XBRL schema object creation process were not reported in the same way as other exceptions thrown by Gepsio.

The constructor of Gepsio’s XbrlSchema class uses an XmlTextReader to read an XBRL schema. If the URI for the XBRL schema to be read is an HTTP-based URI, then the XmlTextReader will use the .NET Web stack to read the schema using HTTP. If something fails during that process, the .NET Web stack will throw a WebException.

In the Nov 2011 CTP (and, in fact, all Gepsio CTPs to this point), thrown WebException objects were not wrapped in an XbrlException object and were consequently thrown back to the client as a WebException object.

To be clear that the issue is an XBRL issue caused by an HTTP failure, the XBRL schema creation code now creates an XbrlException object, stores the caught WebException as an inner exception to the XbrlException, and throws the XbrlException object back up to the client.

I have just checked in a fix for the issue. The fix will be available in the next release (currently planned for Jul 2012). If you want to grab the code ahead of time, feel free to grab the latest source code here.

11 comments:

  1. Don't know if it's the case, but in

    internal XbrlSchema(XbrlFragment ContainingXbrlFragment, string SchemaFilename, string BaseDirectory)

    When SchemaFilename is an http url the code just read it as a file:

    this.Path = GetFullSchemaPath(SchemaFilename, BaseDirectory);

    For example: with SchemaFilename = 'http://www.svs.cl/cl/fr/ci/2008-10-31/cl-ci_ias-23_2007-03-29/cl-ci_ias-23_2007-03-29.xsd'

    this.Path = 'file:///D:/my/localFolder/http://www.svs.cl/cl/fr/ci/2008-10-31/cl-ci_ias-23_2007-03-29/cl-ci_ias-23_2007-03-29.xsd'

    With this, in

    var schemaReader = XmlTextReader.Create(this.Path);

    the code throws a System.NotSupportedException.


    You're talking about this?

    Greetings and sorry for my poor english!

    ReplyDelete
  2. Thanks for the report! You might want to go to http://gepsio.codeplex.com/workitem/list/basic and file a bug report so I can take a look at this issue and get it on the bug report list.

    ReplyDelete
    Replies
    1. Hi Jeff any resolution on the issue submitted by Juan Pablo Araya. I tried to parse an XBRL whose URI refers to Http. I resolved it by not adding the local path. but it wont get the Facts of the documents, it successfully returned the contexts. not sure if this issue is brought your notice.

      Thanks

      Delete
    2. I have good news! I just checked in a fix for that issue. I will be releasing a new CTP within the next day or two, and the fix will be in there. You can find out about the new CTP when I release it at the project page at http://gepsio.codeplex.com or on the Facebook page at http://www.facebook.com/gepsio. A Twitter account will be coming soon!

      Delete
    3. Thanks Jeff, I got the changes. currently I am evaluating Gepsio to use in our organization for Parsing corporate actions for Dividends. I was not succesful, able to load the contexts but the source code does not recognise any facts and not loading the labels. not much help available how to retrive Labels. The namespace refers to http, please advise.

      sample xmlnamespace part and the context with segment:

      - - - Citibank - ca:CashDividendMember ca:EquityMember ca:MandatoryMember ca:UnitedStatesMember ca:ConfirmedMember - 2012-09-07 2012-09-07 - - Citibank - ca:CashDividendMember ca:EquityMember ca:MandatoryMember ca:UnitedStatesMember ca:ConfirmedMember - 1 - 1 - 2012-09-07 2012-09-07

      Delete
    4. Thanks for the report! I will take a look at this over the weekend so that your organization can continue the evaluation. I want you to be successful. Please file a bug report at http://gepsio.codeplex.com/workitem/list/basic and please attach the XBRL instance that is giving you problems as well as all associated schemas and linkbase documents. Feel free to post additional information on the Gepsio Facebook page at http://www.facebook.com/Gepsio or to the Gepsio Twitter account at @GepsioXbrl. Thank you!

      Delete
    5. Thanks for the prompt reply, I will verify if I can release the production data and login the bug with attachments on Monday. Goof weekend.

      Delete
    6. Not a problem! I will most likely be releasing a Sep 2012 CTP this weekend. If you and I can work together on this issue as a bug, I will fix it in an Oct 2012 CTP.

      Delete
    7. Hi Jeff, thanks for your time. I created the Item #9632 and uploaded the supporting Cash Dividend XBRL document

      Thanks

      Delete
    8. Hi Jeff any luck on the Item #9632. Also what major Taxonomies Gepsio supports now. with Corporate Actions seems to have some issues

      Delete