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

RE: Corrupted contedt when using utf-8 with Hebrew values in XML



Same program? Just linked to different versions? Because your data seems screwed up...

GOOD senddoc(): entered

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><SendSmsAr
ray
xmlns="http://www.telemessersms.co.il/webservice/";><UserName>ibmas400</UserN
ame><EncryptPassword>11dd86d4e30747db90ce3c99179320f6</EncryptPassword><Subs
cribers>0544441891</Subscribers><Message><string>????</string><string>?????<
/string><string>??????</string></Message><SenderName>HERTZ</SenderName><Deli
veryDelayInMinutes>1</DeliveryDelayInMinutes><ExpirationDelayInMinutes>10</E
xpirationDelayInMinutes></SendSmsArray></soap:Body></soap:Envelope>

BAD senddoc(): entered

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><SendSmsAr
ray
xmlns="http://www.telemessersms.co.il/webservice/";><UserName>ibmas400</UserN
ame><EncryptPassword>11dd86d4e30747db90ce3c99179320f6</EncryptPassword><Subs
cribers>0544441891</Subscribers><Message><string>????</string><string>?????<
/string><string>??????</string></Message><SenderName>HERTZ</SenderName><Deli
veryDelayInMinutes>1</DeliveryDelayInMinutes><ExpirationDelayInMinutes>10</E
xpirationDelayInMinutes></SendSmsArray></soap:Body><<?xml version="

All good until the last line... Seems like some kind of oops there.

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Thursday, September 05, 2013 3:40 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Corrupted contedt when using utf-8 with Hebrew values in XML

Hello Boaz,

There was no changes made to the senddoc() routine between 1.23 and 
1.24.  Or anything else that I can find that would affect the 
translation to UTF-8.

Is it possible that the problem also occurred in 1.23?  Or that perhaps 
you are picking up an older copy of HTTPAPIR4 from some other library?  
There was a problem exactly like you describe in HTTPAPI 1.17, but it 
has been fixed since version 1.18 was released.  And, again, there was 
no changes here between 1.23 and 1.24.  So I wonder if somehow you've 
got a copy of 1.17 in your library list that you're picking up by mistake?

Let me know your thoughts.
-SK


On 9/5/2013 3:01 PM, Boaz mermelstein wrote:
>     Hi
>
>     I have a problem sending web service request contains Hebrew with CCSID
>     1208 (utf-8).
>
>     Thanks in advance for any help.
>
>
>     In HTTPAPI 1.23, it works fine, XML is valid, while in 1.24 there is a
>     problem converting the xml buffer from CCSID=424 (EBCDIC Hebrew) to
>     CCSID=1208 (utf-8).
>
>     Since 424 is a single byte code page, while 1208 is a multi bytes code
>     page, length of converted buffer should be increase.
>
>     At the position of original buffer length, conversion is stopped, and
>     beginning of original buffer is copied again.
>
>     Look at the following examples in senddoc() : entered at the end of
>     XML.
>
>
>     This is a good one from version 1.23
>
>     ==============================
>
>     HTTPAPI Ver 1.23 released 2008-04-24
>
>     OS/400 Ver V6R1M0
>
>
>     New iconv() objects set, PostRem=1208. PostLoc=424. ProtRem=1208.
>     ProtLoc=0
>
>     http_persist_open(): entered
>
>     http_long_ParseURL(): entered
>
>     DNS resolver retrans: 2
>
>     DNS resolver retry  : 2
>
>     DNS resolver options: x'00000136'
>
>     DNS default domain: HERTZ.CO.IL
>
>     DNS server found: 192.168.46.44
>
>     http_persist_post(): entered
>
>     http_long_ParseURL(): entered
>
>     do_post(): entered
>
>     POST /WebService/SendSmsWS.asmx HTTP/1.1
>
>     Host: www.telemessersms.co.il
>
>     User-Agent: BMAgent
>
>     Content-Type: text/xml; charset=utf-8
>
>     SOAPAction: http://www.telemessersms.co.il/webservice/SendSmsArray
>
>     Expect: 100-continue
>
>     Content-Length: 697
>
>
>
>     recvresp(): entered
>
>     HTTP/1.1 100 Continue
>
>
>
>     SetError() #13: HTTP/1.1 100 Continue
>
>     senddoc(): entered
>
>     <?xml version="1.0" encoding="utf-8"?><soap:Envelope
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><Send
>     SmsArray
>     xmlns="http://www.telemessersms.co.il/webservice/";><UserName>ibmas400</
>     UserName><EncryptPassword>11dd86d4e30747db90ce3c99179320f6</EncryptPass
>     word><Subscribers>0544441891</Subscribers><Message><string>Z+W+H+J+</st
>     ring><string>H+W+D+E+H+</string><string>B+E+B+R+J+T+</string></Message>
>     <SenderName>HERTZ</SenderName><DeliveryDelayInMinutes>1</DeliveryDelayI
>     nMinutes><ExpirationDelayInMinutes>10</ExpirationDelayInMinutes></SendS
>     msArray></soap:Body></soap:Envelope>
>
>     recvresp(): entered
>
>     HTTP/1.1 200 OK
>
>     Cache-Control: private, max-age=0
>
>     Content-Type: text/xml; charset=utf-8
>
>     Server: Microsoft-IIS/7.0
>
>     X-AspNet-Version: 4.0.30319
>
>     Set-Cookie: ASP.NET_SessionId=4uhlngbr0hlxw422upxun5v2; path=/;
>     HttpOnly
>
>     Set-Cookie: User=1436; path=/
>
>     X-Powered-By: ASP.NET
>
>     Date: Thu, 05 Sep 2013 08:34:24 GMT
>
>     Content-Length: 551
>
>
>
>     SetError() #13: HTTP/1.1 200 OK
>
>     recvdoc parms: identity 551
>
>     header_load_cookies() entered
>
>     cookie_parse() entered
>
>     cookie =  ASP.NET_SessionId=4uhlngbr0hlxw422upxun5v2; path=/; HttpOnly
>
>     cookie attr asp.net_sessionid=4uhlngbr0hlxw422upxun5v2
>
>     cookie attr path=/
>
>     cookie attr httponly=
>
>     cookie_parse() entered
>
>     cookie =  User=1436; path=/
>
>     cookie attr user=1436
>
>     cookie attr path=/
>
>     recvdoc(): entered
>
>     SetError() #0:
>
>     <?xml version="1.0" encoding="utf-8"?><soap:Envelope
>     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema";><soap:Body><SendSmsArrayRe
>     sponse
>     xmlns="http://www.telemessersms.co.il/webservice/";><SendSmsArrayResult>
>     <result>OK</result><Messages><Message><ID>119707236</ID><Cli>+972544441
>     891</Cli><Status>QUEUED</Status><CreateDate>0001-01-01T00:00:00</Create
>     Date></Message></Messages></SendSmsArrayResult></SendSmsArrayResponse><
>     /soap:Body></soap:Envelope>
>
>     http_close(): entered
>
>
>     =======================================================================
>     ================================
>
>
>     This is a bad one from 1.24
>
>     =======================
>
>     HTTPAPI Ver 1.24 released 2012-01-23
>
>     OS/400 Ver V6R1M0
>
>
>     New iconv() objects set, PostRem=1208. PostLoc=424. ProtRem=1208.
>     ProtLoc=0
>
>     http_persist_open(): entered
>
>     http_long_ParseURL(): entered
>
>     DNS resolver retrans: 2
>
>     DNS resolver retry  : 2
>
>     DNS resolver options: x'00000136'
>
>     DNS default domain: HERTZ.CO.IL
>
>     DNS server found: 192.168.46.44
>
>     http_persist_post(): entered
>
>     http_persist_req(POST) entered.
>
>     http_long_ParseURL(): entered
>
>     do_oper(POST): entered
>
>     There are 0 cookies in the cache
>
>     POST /WebService/SendSmsWS.asmx HTTP/1.1
>
>     Host: www.telemessersms.co.il
>
>     User-Agent: BMAgent
>
>     Content-Type: text/xml; charset=utf-8
>
>     SOAPAction: http://www.telemessersms.co.il/webservice/SendSmsArray
>
>     Content-Length: 697
>
>
>
>     senddoc(): entered
>
>     <?xml version="1.0" encoding="utf-8"?><soap:Envelope
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><Send
>     SmsArray
>     xmlns="http://www.telemessersms.co.il/webservice/";><UserName>ibmas400</
>     UserName><EncryptPassword>11dd86d4e30747db90ce3c99179320f6</EncryptPass
>     word><Subscribers>0544441891</Subscribers><Message><string>Z+W+H+J+</st
>     ring><string>H+W+D+E+H+</string><string>B+E+B+R+J+T+</string></Message>
>     <SenderName>HERTZ</SenderName><DeliveryDelayInMinutes>1</DeliveryDelayI
>     nMinutes><ExpirationDelayInMinutes>10</ExpirationDelayInMinutes></SendS
>     msArray></soap:Body><<?xml version="
>
>     recvresp(): entered
>
>     HTTP/1.1 400 Bad Request
>
>     Cache-Control: private
>
>     Content-Type: text/xml; charset=utf-8
>
>     Server: Microsoft-IIS/7.0
>
>     X-AspNet-Version: 4.0.30319
>
>     X-Powered-By: ASP.NET
>
>     Date: Thu, 05 Sep 2013 08:37:18 GMT
>
>     Content-Length: 0
>
>
>
>     SetError() #13: HTTP/1.1 400 Bad Request
>
>     recvresp(): end with 400
>
>     recvdoc parms: identity 0
>
>     header_load_cookies() entered
>
>     recvdoc(): entered
>
>     SetError() #0:
>
>     SetError() #13: HTTP/1.1 400 Bad Request
>
>     http_close(): entered
>
>
>     Regards
>
>     LogoWhiteSmall
>
>     Boaz Mermelstein
>
>     3/21 Hershko Avraham st. |  Rehovot   |  Israel
>
>     Phone: +972 8 9458690  |  Mobile:+972 54 4441 891  |  Fax: +972 151 54
>     4441 891
>
>     http://www.smbt.co.il
>
>
>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------