views:

47

answers:

3

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.

A: 

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.

Jon Skeet
How do i add logging to the web service?I know the data is making it to the server when i go to the webservice because its in a Access DB and its all there...
Sean P
Another thing worth checking is whether you have any null characters in the string, and if so, is it truncating the string at one? For example you can't return a string that has a null character in it as data in ASP.NET AJAX, as the client side will choke on the null character.
Matt Greer
well i tried just returning a bunch of 1's followed but 2's and 3' and 4's and they make it into the DB but when i search and return it... truncated.
Sean P
@Sean P: Add logging using Log4Net or any of the other normal logging solutions. Or just write directly to a text file, in a pinch. When you say "when i search and return it... truncated" do you mean in the web service? What if you write a little console app to *just* perform the same query? Do you get the data back then?
Jon Skeet
@Jon the problem is that I am intergrating with ClearQuest and this method has worked before. I think I am missing something. The DB is MS Access, if that means anything. ClearQuest the program can read the data no problem. When i run the query to pull the field that has the long string in it and pass it back to my web page it gets truncated at 255 characters.
Sean P
@Sean P: I still say logging is the way to go. Check whether when you've genuinely fetched the data *in the web service*, you've got it all.
Jon Skeet
Ok let me try that and get back to you tomorrow
Sean P
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.
Sean P
A: 

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.

Tychumsempir
A: 

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.

Sean P