Forum Stats

  • 3,840,393 Users
  • 2,262,599 Discussions
  • 7,901,262 Comments

Discussions

How to verify that java string is valid and doesn't contain EOF?

Magwaa
Magwaa Member Posts: 84
edited Apr 1, 2016 3:53AM in Java Technology & XML

Dear All,

  I wrote SOAP based web service in Java to sync data between multiple locations. The Service works fine with almost all the data but crashes when a string having machine readings is sent.

The Example data in a string is:

"

0H|\^&|||ARCHITECT^5.00^Number1^H1P1O1R1C1Q1L1|||||||P|1|20091128163744

83

1P|1|||||||U

F7

2O|1|135682|135682^C272^2|^^^721^HIV Ag/Ab^UNDILUTED^P|R||||||||||||||||||||F

01

3R|1|^^^721^HIV Ag/Ab^UNDILUTED^P^78170HN00^00802^^F|0.19|S/CO||||F||||20091128162538|iSR06355

17

4R|2|^^^721^HIV Ag/Ab^UNDILUTED^P^78170HN00^00802^^I|Nonreactive|||||F||||20091128162538|iSR06355

BE

5R|3|^^^721^HIV Ag/Ab^UNDILUTED^P^78170HN00^00802^^P|447|RLU||||F||||20091128162538|iSR06355

DB

6L|1

3F"

When i pass this string the service crashes saying that if found unexpected end of file. I have devised a way to sort it out as i am dealing this format as a Char. Now what i want is to differentiate between the conventional string and string having such data. Any guess or help anyone can offer?

Regards,

--Magwaa

This discussion has been closed.