gpt4 book ai didi

web-services - Web 服务调用导致 System.Xml.XmlException : '.' , 十六进制值 0x00

转载 作者:行者123 更新时间:2023-12-04 16:01:31 26 4
gpt4 key购买 nike

我从我的 Web 服务中抛出了以下未处理的异常 - 这与我的代码没有任何关系,它只会在多次异步调用服务器时间歇性地发生。我已经包含了我返回的代码响应对象,这是唯一返回的对象(在这种情况下,通用响应是一个字符串列表)。
有没有人遇到过这个,知道为什么 Web 服务可能会抛出这个?

整个堆栈跟踪:

System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 4, position -88.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Int32 pos, Char invChar)
at System.Xml.XmlTextReaderImpl.ParseNumericCharRefInline(Int32 startPos, Boolean expand, BufferBuilder internalSubsetBuilder, Int32& charCount, EntityType& entityType)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
at System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.ReadElementString()
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPartsLibraryService.Read29_GenericResponseOfListOfString(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPartsLibraryService.Read34_UploadPartsResponse()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer5.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

简单响应对象(伪代码):
Public Class GenericResponse(Of T)
Public Enum StateOptions

Private _result As T
Private _state As StateOptions
Private _msg As String

Public Property Result() As T
Public Property State() As StateOptions
Public Property Message() As String
End Class

我跑了 fiddler,但这是我唯一没有看到的异常结果,但我认为它不会导致我遇到的问题?
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><UploadPartsResponse xmlns="http://autovhc.co.uk/"><UploadPartsResult><Result><string>--------------------------------------------------
01/06/2011 14:38:33
Upsert Exception
Backend sent unrecognized response type: &#x0;
at Npgsql.NpgsqlState.&lt;ProcessBackendResponses_Ver_3&gt;d__a.MoveNext() in C:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 966
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1163
at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1181
at Npgsql.ForwardsOnlyDataReader.NextResult() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1367
at Npgsql.NpgsqlCommand.ExecuteNonQuery() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 523
at VHC.Connections.DataAccess2.DataAccess.sqlNonQuery(NpgsqlCommand sqlCmd, Boolean closeConnection) in E:\svn_repository\vhc.server.solution\vhc.connections\Tags\v_3_0_0_5\New\ConnectionProxys\DataAccess.vb:line 119
at VHC.Connections.DataAccess2.DataAccess.sqlNonQuery(NpgsqlCommand sqlCmd) in E:\svn_repository\vhc.server.solution\vhc.connections\Tags\v_3_0_0_5\New\ConnectionProxys\DataAccess.vb:line 97
at PartsLibServerSideClasses.DAO.PLM_PsaFormat_DAO.Update(PartLibraryPartTO part, Int32 entityref, NpgsqlConnection conn) in C:\Applications\PartsImporter\Import_Library-Stable\PartsLibServerSideClasses\DAO\PSA\PLM_PsaFormat_DAO.vb:line 61
at PartsLibServerSideClasses.DAO.PLM_PsaFormat_DAO.Upsert(PartLibraryPartTO part, Int32 entityref) in C:\Applications\PartsImporter\Import_Library-Stable\PartsLibServerSideClasses\DAO\PSA\PLM_PsaFormat_DAO.vb:line 21
at PartsLibServerSideClasses.Parsing.PartsLibraryManager.SubmitPartToLibrary(PartLibraryPartWorkSegmentContainer partContainer) in C:\Applications\PartsImporter\Import_Library-Stable\PartsLibServerSideClasses\BOL\PartsLibraryManager.vb:line 70
</string></Result><State>Fail</State></UploadPartsResult></UploadPartsResponse></soap:Body></soap:Envelope>

最佳答案

我之前在错误代码中看到过这一点,当用户将值从另一个应用程序复制/粘贴到数据库字段中时,这些错误代码没有编码或删除 0,然后这些记录的零一直出现到 xml 解析器。

关于web-services - Web 服务调用导致 System.Xml.XmlException : '.' , 十六进制值 0x00,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6185766/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com