none
Exception of calling webservice's method RRS feed

  • Question

  • I call a webservice's method  from UI,there is a Exception on the service's method when parse the parameter which include list object.

    it seems like there is some wrong at  the xml file of  paramter,the parameter's size too large or there's unregular character in XML? PLEAE HELP ME 3Q.

    ------

    1) Exception Information

     

    Exception Type: System.Web.Services.Protocols.SoapException

    Actor:

    Detail: NULL

    Lang:

    Node:

    Role:

    SubCode: NULL

    Message: Server was unable to read request.

    Data: System.Collections.ListDictionaryInternal

    TargetSite: System.Object[] ReadParameters()

    HelpLink: NULL

    Source: System.Web.Services

     

    StackTrace Information

       at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()

       at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

     

    2) Exception Information

     

    Exception Type: System.InvalidOperationException

    Message: There is an error in XML document (1, 1900545).

    Data: System.Collections.ListDictionaryInternal

    TargetSite: System.Object Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)

    HelpLink: NULL

    Source: System.Xml

     

    StackTrace Information

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)

       at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()

     

    3) Exception Information

     

    Exception Type: System.Xml.XmlException

    LineNumber: 1

    Line"EN-US">SourceUri:

    Message: Unexpected end of file has occurred. The following elements are not closed: ConstName, SPP21001ConstEntity, ConstList, req, UpdateApprove, soap:Body, soap:Envelope. Line 1, position 1900545.

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void Throw(System.Exception)

    HelpLink: NULL

    Source: System.Xml

     

    StackTrace Information

       at System.Xml.XmlTextReaderImpl.Throw(Exception e)

       at System.Xml.XmlTextReaderImpl.ThrowUnclosedElements()

       at System.Xml.XmlTextReaderImpl.ParseElementContent()

       at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()

       at System.Xml.XmlReader.ReadString()

       at System.Xml.XmlReader.ReadElementString()

       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read12_SPP21001ConstEntity(Boolean isNullable, Boolean checkType)

       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read14_SPP21001UpdateApproveRequest(Boolean isNullable, Boolean checkType)

       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read21_UpdateApprove()

       at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer4.Deserialize(XmlSerializationReader reader)

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

    Friday, September 27, 2013 7:43 AM

Answers

All replies

  • As you can see, the xml isn't complete. You're missing some end tags. Please take a look at the error message again:

    Message: Unexpected end of file has occurred. The following elements are not closed: ConstName, SPP21001ConstEntity, ConstList, req, UpdateApprove, soap:Body, soap:Envelope. Line 1, position 1900545.

    Maybe you're concatenating strings to build the xml? If that is the case, I would check those places in your code to make sure nothing strange is added that could make the xml parser go bananas. 


    • Edited by Papageno Sweden Friday, September 27, 2013 9:07 AM Spelling error
    Friday, September 27, 2013 9:06 AM
  • can you post the signature of your webservice method

    Happy Coding, RDRaja

    Friday, September 27, 2013 10:26 AM
  • Try to copy the input xml file form the UI client and and save it locally and open in with some xml editor or internet explorer then you will come to know the defects in the xml input file generated if any.
    Friday, September 27, 2013 11:38 AM