AW: NumberFormatException parsing HTTP-Header

"Malte Kempff" <[email protected]>
Newsgroups gmane.text.xml.soap.user
Message-ID <[email protected]>
hi,
well that I think everybody knows who ' got java know how.
the troble is on what place in the soap source trim the string ;-)

Malte

-----Ursprüngliche Nachricht-----
Von: Daniel Zhang [mailto:[email protected]]
Gesendet: Freitag, 2. April 2004 22:40
An: [email protected]
Betreff: Re: NumberFormatException parsing HTTP-Header


Simple fix is to use string.trim() to trim any white spaces.

String s = "3957 ";
int i = Integer.parseInt(s.trim());

Hope this helps.

-Daniel


[email protected] wrote:

> Hi,
>
>
>
> Has there been any fix implemented for the bug mentioned in this
> mailing list where Apache SOAP specifically does not strip the
> trailing white space from the Content-Length, so when it calls
> Integer.parseInt() with a value: "3957  " for example, a
> NumberFormatException is thrown.
>
>
>
> Is there anyway of getting around this problem other than changing to
> another SOAP implementation?
>
>
>
> Liam
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete
> the original. Any other use of the email by you is prohibited.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.