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

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



Hi Scott,

I've got it !

The solution for "Invalid byte .. bla bla ..." was :
I must specify the charset param 
'text/xml;charset=UTF-8' (or iso-8859-1 depending ..)

But, after solving this problem, the new message was :
'Authentication problem !'

My XML flow contains :

+'    <drc:user>'                                 
+'      <drc:userpass>'                           
+'        <drc:name>Stephane@SAFE</drc:name>'     
+'        <drc:pwd type="text">test812</drc:pwd>' 
+'      </drc:userpass>'                          
+'    </drc:user>'                                

My iseries is a French one (CCSID 1147)

The @ sign was not correctly converted !

If I compile my program inside a job with CCSID=65535 it works !
I can run it inside a job with CCSID 1147 (French Euro) or CCSID 297 (French)

If I compile my program inside a job with CCSID 1147 or 297, it fails with the authentication message.

May be we have a conversion problem inside HTTP API ?

What is your opinion ?

Best regards

Alain RUAS
Technical Manager
(33) 562 747 500
 
 

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

Hi Alain,

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

The content-type is a parameter that you pass from your program to 
HTTPAPI.  From your earlier message, you said your code looks like
this:

    rc = http_url_post( 'http://192.36.95.109:8080/drc/drc'
                      : %addr(SOAP) + 2
                      : %len(SOAP)
                      : '/tmp/DrcMsg.txt'
                      : HTTP_TIMEOUT
                      : HTTP_USERAGENT
                      : 'text/xml'
        : 'http://192.36.95.109:8080/drc/drc/constructRoutes');

Take a close look at the 7th parameter.

I also note another discrepancy between your pgm and SoapUI.  SoapUI has 
this:

    SOAPAction: "drcns:constructRoutes"

Whereas your pgm has this:

    SOAPAction: http://192.36.95.109:8080/drc/drc/constructRoutes

I wonder where you found that SoapAction?  I would've expected you to 
get that value from SoapUI.  I guess not!

Anyway, perhaps your code should look like this?

rc = http_url_post( 'http://192.36.95.109:8080/drc/drc'
                   : %addr(SOAP) + 2
                   : %len(SOAP)
                   : '/tmp/DrcMsg.txt'
                   : HTTP_TIMEOUT
                   : HTTP_USERAGENT
                   : 'text/xml;charset=UTF-8'
                   : '"drcns:constructRoutes"');

Good luck.
-----------------------------------------------------------------------
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
-----------------------------------------------------------------------