XML Web Service fails with System.InvalidOperationException returning a DataSet with RowErrors

Discussion in 'ASP .Net Web Services' started by Curly, Aug 19, 2003.

  1. Curly

    Curly Guest

    QuickStart app "Update.EXE"
    (installed to C:\Program Files\Microsoft Visual Studio .NET
    2003\SDK\v1.1\QuickStart\winforms\samples\data\update\cs)

    ....fails with the following error message when row 4
    (key/customer ID "LETSS") or row 12 (key/customer ID "TRAIH") is
    modified and saved.

    This exception should not be raised.

    Instead, the DataSet should be returned to the calling client
    program so that it can report the RowErrors to the user.
    (lines 392 thru 404 of UpdateForm.cs)

    These rows contain apostrophes (') in the CompanyName column and
    the Web Service UpdateCustomers.asmx contains code that
    validates the columns checks for invalid characters using
    Acme.InputValidator.IsSafeText()
    The web service sets row.RowError and calls row.SetColumnError()
    (lines 116 and 117 of UpdateCustomers.asmx.cs)

    When these RowErrors are returned to the calling client, an
    unexpected exception is raised as below:

    "System.InvalidOperationException: There is an error in XML
    document (1, 2556). ---> System.NullReferenceException: Object
    reference not set to an instance of an object.\r\n at
    System.Xml.Serialization.XmlSerializationReader.UnknownNode(XmlNo
    de unknownNode, Object o)\r\n at
    System.Xml.Serialization.XmlSerializationReader.UnknownNode(Objec
    t o)\r\n at
    Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationRea
    der1 .Read3_SaveResponse()\r\n --- End of inner exception
    stack trace -- -\r\n at
    System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
    xmlReader, String encodingStyle)\r\n at
    System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
    xmlReader)\r\n at
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse
    (Soa pClientMessage message, WebResponse response, Stream
    responseStream, Boolean asyncCall)\r\n at
    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(Strin
    g methodName, Object[] parameters)\r\n at
    Microsoft.Samples.Windows.Forms.Cs.Update.localhost.UpdateCustome
    rs.S ave(DataSet customersDataSet) in C:\\Program
    Files\\Microsoft Visual Studio .NET
    2003\\SDK\\v1.1\\QuickStart\\winforms\\samples\\data\\update\\cs\
    \Cli ent\\Web References\\localhost\\UpdateCustomers.cs:line
    31\r\n at
    Microsoft.Samples.Windows.Forms.Cs.Update.UpdateForm.SaveData()
    in c:\\program files\\microsoft visual studio .net
    2003\\sdk\\v1.1\\quickstart\\winforms\\samples\\data\\update\\cs\
    \cli ent\\updateform.cs:line 211\r\n at
    Microsoft.Samples.Windows.Forms.Cs.Update.UpdateForm.buttonSave_C
    lick (Object sender, EventArgs e) in c:\\program
    files\\microsoft visual studio .net
    2003\\sdk\\v1.1\\quickstart\\winforms\\samples\\data\\update\\cs\
    \cli ent\\updateform.cs:line 389"

    To reproduce this:
    - Open solution "Update.sln" in the QuickStart... directory (see
    "installed to" directory above)
    - F5 (Start)
    - Click ">" (next) on the VCR until CustomerID "LETSS",
    CompanyName "Let's Stop N Shop" is displayed
    * Add a single SPACE to the end of any field.
    - Press "Save" button.

    -- Mark
    Visual Studio .NET 2003 version 7.1.3088
    Microsoft .NET Framework 1.1 version 1.1.4322
    Windows 2000 Server 5.00.2195 SP4 253,424KB RAM
     
    Curly, Aug 19, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Kennedy
    Replies:
    0
    Views:
    1,564
    Jeff Kennedy
    Oct 20, 2003
  2. Hari Koduru
    Replies:
    3
    Views:
    1,394
    Natty Gur
    Jan 15, 2004
  3. Tony
    Replies:
    6
    Views:
    7,407
  4. Mark
    Replies:
    0
    Views:
    108
  5. Oleg

    InvalidOperationException When calling web service

    Oleg, Nov 6, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    140
Loading...

Share This Page