views:

46

answers:

2

I have a simple WebService method that returns database results as a DataSet.

This method fails for one user in the company but works for everyone else Here is the crash:

    CRASH! GetCustomer - 
ExtractDomesticCommercialState: Exception:InvalidOperationException 
Message:There is an error in XML document (1, 877). 
Source:     System.Xml TargetSite: Deserialize StackTrace:    
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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)     
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)     
at Cwc.Common.basis2_ws.Basis2WebService.GetRetailChargeGroupByInstId(String instId)     
at Cwc.Common.Basis2ServiceLayer.GetRetailChargeGroupByInstId(String instId)     
at Cwc.WaterWorks.Console.frmMain.GetCustomer(String customerKey, Boolean afterCreate)

Exception:FormatException Message:Input string was not in a correct format. 
Source:     mscorlib TargetSite: StringToNumber 
StackTrace:    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)     
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)     
at System.String.System.IConvertible.ToInt32(IFormatProvider provider)     
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)     
at System.Data.XSDSchema.HandleElementColumn(XmlSchemaElement elem, DataTable table, Boolean isBase)     
at System.Data.XSDSchema.HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, Boolean isBase)     
at System.Data.XSDSchema.HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, Boolean isNillable)     
at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef)     
at System.Data.XSDSchema.HandleTable(XmlSchemaElement node)     
at System.Data.XSDSchema.HandleDataSet(XmlSchemaElement node, Boolean isNewDataSet)     
at System.Data.XSDSchema.LoadSchema(XmlSchemaSet schemaSet, DataSet ds)     
at System.Data.DataSet.ReadXSDSchema(XmlReader reader, Boolean denyResolving)     
at System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)     
at System.Data.DataSet.ReadXmlSerializable(XmlReader reader)     
at System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader reader)     
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)     
at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable)     
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderBasis2WebService.Read18_Item()     
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer25.Deserialize(XmlSerializationReader reader)     
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) 

The client is a .Net WinForms application I have verified the method in the Webservice is generating XML correctly Just seems the deserialisation fails

Could it be because she is running .Net Framework 4 and the application was built for 3.5?

A: 

look at the middle of your stack trace...

at Cwc.WaterWorks.Console.frmMain.GetCustomer(String customerKey, Boolean afterCreate)

Exception:FormatException Message:Input string was not in a correct format. 
Source:     mscorlib TargetSite: StringToNumber 
StackTrace:    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)     
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) 

Seems like a parsing error from String to Int .... I suggest you try and investigate this area.

Si Robinson
Yes but the XML is fine, all the numbers look properly formed. And why does it fail on just her machine?
Sam Mackrill
+1  A: 

Exception:FormatException Message:Input string was not in a correct format

Is the culture on the user's machine the same as the others which are working? Just an idea as it may be using a different culture therefore using a different IFormatProvider

amarsuperstar
Could be, we are beginning to suspect it is something in the User profile.
Sam Mackrill
We have rebuilt the User Profile and it is now working.
Sam Mackrill
Which User Profile do you mean? Something specific to the application or within Active Directory? Just curious :)
amarsuperstar