开发者

Why does my WebService call fail only for one user?

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.Serializat开发者_JS百科ion.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?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜