CodeSmith Community
Your Code. Your Way. Faster!

WebServiceClient generated provider does not check for null result!

Latest post 01-26-2007 10:24 AM by Robert Hinojosa. 1 replies.
  • 01-25-2007 10:23 PM

    • Kim
    • Not Ranked
    • Joined on 01-26-2007
    • Posts 1
    • Points 35

    WebServiceClient generated provider does not check for null result!

    Hi,

     I'm currently evaluating NetTiers and so far I've been very impressed by what I've seen. I was testing the generated WebServiceClient code on a simple application I've made. I was suprised to find that when I use the generated provider to Get an Entity using its unique primary key, the generated provider class does not check for null return which leads to a NullReferenceException later on. Here's the code:

     

    public override DTS.Entities.Timesheet GetByTimesheetID(TransactionManager transactionManager, System.Guid timesheetID, int start, int pageLength, out int count)

    {

    WsProxy.DTSServices proxy = new WsProxy.DTSServices();

    proxy.Url = Url;

    WsProxy.Timesheet items = proxy.TimesheetProvider_GetByTimesheetID(timesheetID, start, pageLength, out count);

     

    return Convert(items);

    }

     If the enitity doesn't exists, the item becomes null which leads to a crash in the Convert method. Does anyone know if it is intentional for NetTiers to generate a NullReferenceException if the Entity doesn't exist? I would have expected a null return.

     

    Is this intentional or is it a bug?

     

    Cheers,

    Kim

    • Post Points: 35
  • 01-26-2007 10:24 AM In reply to

    Re: WebServiceClient generated provider does not check for null result!

    Hi Kim,

    This looks to be a bug, thanks for the report!


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems