CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    635

    [RESOLVED] Issue Web Service and ASP.Net

    hi everyone

    I am facing an issue
    An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.dll Additional information: Error en el documento XML (1, 1634).
    When I invoke a web service it trigers error message, I figure out it is when data retrieved from web service has character especials.

    any setting to fix it??


    thanks in advance

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Issue Web Service and ASP.Net

    it might be mainly a matter of permissions?
    ie:
    http://stackoverflow.com/questions/6...class-result-1

    but if you think it is only when special chars are involved, you should ask to those who developed the web service (or look better at the service exposed methods )
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Sep 2006
    Posts
    635

    Re: Issue Web Service and ASP.Net

    thanks for reply

    I already solve it

    web service method returns a datatable when I changed method so it returns a dataset. the error message is not showed and everything work fine.



    But I think , why????

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: [RESOLVED] Issue Web Service and ASP.Net

    something remind me that you could not send datatables through ws, only dataset (that is: you have to warp datatables inside a dataset). Something related on how serialization is done:
    thus I searched and found it here:
    http://support.microsoft.com/kb/306134
    The DataTable, DataRow, DataView, and DataViewManager objects cannot be serialized and cannot be returned from an XML Web service. To return less than a complete DataSet, you must copy the data that you want to return to a new DataSet.
    mistake come from long past when we read :
    http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx
    the version 1.1 of framework spoke about datatable being serializable pe se, but code uses dataset (you can see the difference with 4.0, where datatables are less enphatized)
    version 1.1
    the DataSet and DataTable are "serializable" in that they can be specified as an input to or output from XML Web services without any additional coding required to stream the contents of the DataSet from an XML Web service to a client and back. The DataSet is implicitly converted to an XML stream using the DiffGram format, is sent over the network, and is then reconstructed from the XML stream as a DataSet on the receiving end. This gives you a very simple and flexible method for transmitting and returning relational data using XML Web services.
    version 4.0
    The DataSet was architected with a disconnected design, in part to facilitate the convenient transport of data over the Internet. The DataSet is "serializable" in that it can be specified as an input to or output from XML Web services without any additional coding required to stream the contents of the DataSet from an XML Web service to a client and back. The DataSet is implicitly converted to an XML stream using the DiffGram format, sent over the network, and then reconstructed from the XML stream as a DataSet on the receiving end. This gives you a very simple and flexible method for transmitting and returning relational data using XML Web services
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured