How can I determine what is really going wrong?

Last post 05-14-2008 5:20 AM by n3llyb0y. 4 replies.

Sort Posts:

  • How can I determine what is really going wrong?

    05-09-2008, 12:54 PM
    • Loading...
    • n3llyb0y
    • Joined on 05-09-2008, 12:49 PM
    • Posts 3

    Hello there - I'm quite new to WebServices and asp.net and I've exhausted my
    troubleshooting capacity on this one.

    I am running a lookup method against a remote webservice and am expecting
    some data back. It would seem as if the response I am getting back is
    actually missing a field and/or cannot be converted from '' (Blank?) to a
    DateTime DataType.

    On the face of it, it seems as if a dateTime conversion is failing - at
    least from my limited view of things.

    Is it possible to narrow down which property is being improperly formatted?

    What other kinds of tests can I run?

    Considering the WebService definition/proxy was built using the WSDL tool
    from a schema file, how appropriate might it be to modify the resultant
    service difinition in order to fix this (if I actually find what the problem
    is!)?

    Sincerely - n
    ***************************************************************

    Server Error in '/Test' Application.
    --------------------------------------------------------------------------------

    The string '' is not a valid AllXsd value.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.FormatException: The string '' is not a valid
    AllXsd value.


    Stack Trace:


    [FormatException: The string '' is not a valid AllXsd value.]
       System.Xml.Schema.XsdDateTime..ctor(String text, XsdDateTimeFlags kinds)
    +1017115
       System.Xml.XmlConvert.ToDateTime(String s, XmlDateTimeSerializationMode
    dateTimeOption) +38
       System.Xml.Serialization.XmlCustomFormatter.ToDateTime(String value) +60
       System.Xml.Serialization.XmlSerializationReader.ToDateTime(String value)
    +30
       Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderpmService.Read11_TicketLookupType(Boolean
    isNullable, Boolean checkType) +2968
       Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderpmService.Read12_LookupTicketResponseType(Boolean
    isNullable, Boolean checkType) +466
       Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderpmService.Read18_lookupTicketResponse()
    +166
       Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer1.Deserialize(XmlSerializationReader
    reader) +40
       System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
    String encodingStyle, XmlDeserializationEvents events) +161

    [InvalidOperationException: There is an error in XML document (8, 463).]
       System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
    String encodingStyle, XmlDeserializationEvents events) +637
       System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
    String encodingStyle) +32
       System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
    message, WebResponse response, Stream responseStream, Boolean asyncCall)
    +1671
       System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    methodName, Object[] parameters) +204
       pmService.lookupTicket(LookupTicketRequestType lookupTicketRequest) +47
       _Default.ticketLookup(String tNum) in
    c:\Inetpub\wwwroot\pmwsTest\Default.aspx.cs:32
       _Default.TicketLookupButton_Click(Object sender, EventArgs e) in
    c:\Inetpub\wwwroot\pmwsTest\Default.aspx.cs:46
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

  • Re: How can I determine what is really going wrong?

    05-09-2008, 1:17 PM
    • Loading...
    • TonyDong
    • Joined on 02-01-2006, 6:30 PM
    • BC, Canada
    • Posts 642

    You can try to write code

    if string.IsNullOrEmpty(s) return Null;

    it can convert empty string to datetime null

    Don't forget to click "Mark as Answer" on the post(s) that helped you.
  • Re: How can I determine what is really going wrong?

    05-13-2008, 11:42 AM
    • Loading...
    • n3llyb0y
    • Joined on 05-09-2008, 12:49 PM
    • Posts 3

    Thanks for the reply - I still require some assistance as I'm not sure where to implement this check...there are a few dozen string and datetime values expected in the lookup results.

    Again, I am a complete novice in this realm - I can see the classes that make up the response type and all properties that are supposed to be DateTime - when retreiving data from the remote web service are the properties represented by the WSDL generated classes being 'Set' and/or 'Get'? I can't quite visualise the interaction.

    Is there a way to find out which property in particular is failing?

    Thanks again!

     

  • Re: How can I determine what is really going wrong?

    05-13-2008, 1:05 PM
    Answer
    • Loading...
    • TonyDong
    • Joined on 02-01-2006, 6:30 PM
    • BC, Canada
    • Posts 642

     

    You have to check every value before you transfer it to stored procedure or retrive it from datareader
    Don't forget to click "Mark as Answer" on the post(s) that helped you.
  • Re: How can I determine what is really going wrong?

    05-14-2008, 5:20 AM
    • Loading...
    • n3llyb0y
    • Joined on 05-09-2008, 12:49 PM
    • Posts 3

    Okay - that was slightly boring but I did finally get to the problematic property.

     Thanks for the guidance!

    n

Page 1 of 1 (5 items)