[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE : Error : Invalid byte 2 of 3-byte UTF-8 sequence



Hi Scott,

I have asked for help from Web Service provider.

Meanwhile, I continue searching by my own.

I have remarked something strange.

When I use SoapUI to send my request, the SoapUI log show this :

DEBUG:>> "POST /drc/drc HTTP/1.1[\r][\n]"
DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
DEBUG:>> "SOAPAction: "drcns:constructRoutes"[\r][\n]"
DEBUG:>> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
DEBUG:>> "Host: 192.36.95.109:8080[\r][\n]"
DEBUG:>> "Content-Length: 923[\r][\n]"
DEBUG:>> "[\r][\n]"
DEBUG:>> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:drc="http://drc99.euronautical.com/";>[\n]"
Etc ...

I remark that SaopUI adds ";charset=UTF-8" after "Content-Type: text/xml"

HTTPAPI log show this :

POST http://192.36.95.109:8080/drc/drc HTTP/1.1
Host: 192.36.95.109:8080
User-Agent: http-api/1.23
Content-Type: text/xml
SOAPAction: http://192.36.95.109:8080/drc/drc/constructRoutes
Expect: 100-continue
Content-Length: 785

recvresp(): entered
SetError() £43: CommTCP_read: No 100-Continue (error ignored)
senddoc(): entered
<?xml version="1.0" encoding="iso-8859-1"?><SOAP:Envelope    xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/";  

May be, HTTPAPI should add "charset = something" like SoapUI ?

What is your opinion ?
  
Alain RUAS
Technical Manager
(33) 562 747 500
 
 

-----Message d'origine-----
De : Scott Klement [mailto:sk@xxxxxxxxxxxxxxxx] 
Envoyé : mer. 17 septembre 2008 19:28
À : HTTPAPI and FTPAPI Projects
Objet : Re: Error : Invalid byte 2 of 3-byte UTF-8 sequence

Hi Alain,

> 
> I try to use it to consume a Web Service and I have this error :
> "Invalid byte 2 of 3-byte UTF-8 sequence"
> 

I don't understand it, either.   I do want to point out that this 
message is being returned from the web service.  It is not issued by 
your program or HTTPAPI.  In fact, it proves that HTTPAPI is doing it's 
job correctly -- the web service is sending you a message, and you're 
receiving it, and that's HTTPAPI's job.

But, I don't understand the message.   How can you have an invalid byte 
of a UTF-8 sequence when you aren't sending UTF-8 to begin with?

Possibly the web service is confused?  Maybe it thinks you're sending 
UTF-8, even though you've told it that the data is iso-8859-1?  Maybe 
this is a bug in the web service and has nothign to do with your code? 
Since SoapUI would've used UTF-8, it probably didn't encounter the error.

You might consider using UTF-8 instead of iso-8859-1 and see if that 
solves the problem.   Make sure you call HTTP_SetCCSIDs() to tell 
HTTPAPI to translate your EBCDIC data to CCSID 1208 (which is UTF-8). 
By default it'll translate to 819 (which is iso-8859-1).
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------