开发者

Web Service is truncating a string in an object being returned... totally lost why

开发者 https://www.devze.com 2022-12-27 13:11 出处:网络
I have a webservice that returns an object i have defined. One of the properties is of the type string and holds a significant amount of characters...over 500 at times. When pass data of the same type

I have a webservice that returns an object i have defined. One of the properties is of the type string and holds a significant amount of characters...over 500 at times. When pass data of the same type TO the webservice, it makes it there and i see the data in my DB. When I return data to the client side, that property is getting truncated everytime. I am lost why

Where is what I have: I return QueryResultPackage.

Public Class SearchResults
    Public IssueID As String
    Public Headline As String
    Public Further_Description As String
    Public Notes As String
    Public OE_Contact As String
    Public Assigned_To As String
    Public Type_Of_Test As String
    Public Bonder_System As String
    Public Bonder_Subsystem As String
    Public Part_Number As String
    Public Revision_Number As String
    Public Serial_Number As String
    Public Bonder_Model As String
    Public Project_Number As String
    Public Severity As String
    Public State As String
End Class

Public Class QueryResultPackage
        Public successful As Boolean
        Public queryResults As List(Of SearchResults)
        Public errorText As String
    End Class

I just found out by doing a .Length that its truncating at 255 characters every time.开发者_如何转开发


My first guess is that it's actually being truncated in a database - and that the web service is faithfully replying with the data it's fetched from the database.

That's the first thing to check: add logging so you can see what data you've got in the properties before they're returned by the web service, and compare those with what the client receives.


I recommend checking the Access DB to make certain that the column's character limit is greater than 255 characters. When you search, are you accessing the table the value is in directly, or are you accessing some sort of view? I don't think that has any affect, but there may be constraints limiting the character count within a view.

I find it interesting that you say it shows up in the database fine, but comes back truncated. 255 sounds too much like an actual character limit to be ignored.


Well I figured out that its the function in my ClearQuest API that im using. For some reason its truncating the data when Access is the database. It shouldnt, but it is.

0

精彩评论

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

关注公众号