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

Re: One Question About Character Conversation .. XML



   Hi again.
   The tool is HTTPAPI.
   I'm using this function:
   rc = http_url_post_stmf(
                      %trimr(URLPost)
                    : %trimr(tmpf)
                    : %trimr(tmprf)
                    : 120                   //Time out
                    : HTTP_USERAGENT
                    : 'text/xml'
                    : SOAPAction);
   Because I ( you Scott) write the response to a ifs file.
   Then I parse it with %xml-into
   // Parsea Tag de Respuesta

      opts    = 'doc=file allowmissing=yes allowextra=yes ' +
                'case=any trim=none ' ;
      opts = %trimr(opts) + ' ' +
             'path=SOAP-ENV:Envelope/SOAP-ENV:Body/' +
                'WS_Calcular_Impuestos'              +
             '.ExecuteResponse/' +
             'Response/'         +
             'XML_Impuestos_Calculados.Impuesto' ;
   // opts = %trimr(opts) + ' ' +
   //        'ccsid=284'                            ;

      ifsFile = %trimr(tmprf) ;
        xml-into %Handler(ImpHnd: xDummy )
                  %XML(ifsFile : opts ) ;
      if not %error();
      endif ;
   As you can see , I tried with CCSID opt code , but RPGLE throws me an
   error.
   The file is saved with CCSID = 1252 , when I change to 284, the
   character are unreadable, all of them, even the one without accents.
   I hope this help to you.
   I attach, httpapi_debug.txt and a XML file that is like the one I
   parse with xml-into.
   This xml file, if I open in my PC with the IE, I can see the accents
   correctly.
   Best Regards
   [1]hr@xxxxxxxxxxxx escribió:

   Looks to me like your are receiving UTF-8 and not CCSID-1252 (dobbelt
   byte instead of SBCS)

   Scott Klement [2]<sk@xxxxxxxxxxxxxxxx>
   Sent by: [3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   02-11-2009 21:58

                             Please respond to
        HTTPAPI and FTPAPI Projects [4]<ftpapi@xxxxxxxxxxxxxxxxxxxxxx>

                                                                       To

   HTTPAPI and FTPAPI Projects [5]<ftpapi@xxxxxxxxxxxxxxxxxxxxxx>

                                                                       cc

                                                                  Subject

   Re: One Question About Character Conversation .. XML

   Can you provide some information about what you're doing?  Is this
   FTPAPI?  HTTPAPI? Something else?
   What routines are you calling?  What are you specifying for the
   CCSIDs?
   Nicolas Machado wrote:
   >    Hi, as you may have noticed, my natural languaje is spanish, and
   we
   >    have something called accents, á,é,í,.. etc.
   >
   >    I'm receiving an XML and procesing the file just fine, except for
   >    those character that I know should be accents.
   >    for example :
   >    "jurisdicción"  instead of "jurisdicción"
   >    Where is the problem here? in the CCSID ? in some step or
   parameter or
   >    maybe because the response doesn't have the encoding tag ?
   ----------------------------------------------------------------------
   -
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [6]http://www.scottklement.com/mailman/listinfo/ftpapi
   ----------------------------------------------------------------------
   -

    _______________________________________________________________________

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
[7]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------


--
.::.
Nicolas Machado
Metodo Argentina S.A.
_____________________
Tel: 02262 527431
Necochea, Buenos Aires.

References

   1. mailto:hr@xxxxxxxxxxxx
   2. mailto:sk@xxxxxxxxxxxxxxxx
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   5. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   6. http://www.scottklement.com/mailman/listinfo/ftpapi
   7. http://www.scottklement.com/mailman/listinfo/ftpapi
<?xml version = "1.0" encoding = "utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
	<SOAP-ENV:Body>
		<WS_Calcular_Impuestos.ExecuteResponse xmlns="GIS20">
			<Request>
				<TpoCbte>0</TpoCbte>
				<DocTpo>80</DocTpo>
				<DocNro>30567839377</DocNro>
				<TipoBien>0</TipoBien>
				<CodConcepto>1</CodConcepto>
				<CodJurEnt>901</CodJurEnt>
				<ImporteSBT>2001000.00</ImporteSBT>
				<ImporteDTOs>0.00</ImporteDTOs>
				<MonCod>0054</MonCod>
				<MonCot>3.8500</MonCot>
				<EsDevolucion>0</EsDevolucion>
				<PagoGranos>0</PagoGranos>
			</Request>
			<Messages>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>----------- Parametros ------------------------
PerCod: 41 - BIENId: 0 - CONCEPID: 1 - Dev: 0
Total_Fac: 2001000.0000 - Desc: 0.0000 - Recargo: 0.0000

</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [901] Previa Tipo 3 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [902] Previa Tipo 2 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [915] Previa Tipo 1 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [904] Previa Tipo 1 --------------------------------
El coeficiente de la jurisdicción es menor al coeficiente del sujeto en jurisdicción
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>La base imponible de la operación es &gt;= a la de la jurisdicción
La Jurisdiccion tiene reducción de IIBB
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [913] Previa Tipo 1 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [917] Previa Tipo 5 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [919] Previa Tipo 1 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [924] Previa Tipo 4 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [921] Previa Tipo 6 --------------------------------
El Sujeto es Agente
</ErrDetalle>
				</XML_Errores.Error>
			</Messages>
			<Response>
				<XML_Impuestos_Calculados.Impuesto>
					<CodImpuesto>IVA</CodImpuesto>
					<TaxDescripcion>IVA</TaxDescripcion>
					<BasImponible>2001000.00</BasImponible>
					<TaxAlic>10.5000</TaxAlic>
					<ImpuestoCalculado>210105.00</ImpuestoCalculado>
					<StringContable>08900000</StringContable>
				</XML_Impuestos_Calculados.Impuesto>
				<XML_Impuestos_Calculados.Impuesto>
					<CodImpuesto>PER_IIBB</CodImpuesto>
					<TaxDescripcion>PERCEPCIÃ?N DE IIB(0)</TaxDescripcion>
					<BasImponible>2001000.00</BasImponible>
					<TaxAlic>0.7500</TaxAlic>
					<ImpuestoCalculado>15007.50</ImpuestoCalculado>
					<StringContable>0898</StringContable>
				</XML_Impuestos_Calculados.Impuesto>
			</Response>
			<Error>OK</Error>
		</WS_Calcular_Impuestos.ExecuteResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
HTTPAPI Ver 1.12 released 2005-08-12

http_url_post_stmf(): entered
getting post file size...
opening file to be sent...
opening file to be received
http_persist_open(): entered
http_long_ParseURL(): entered
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /gis20/aws_calcular_impuestos.aspx HTTP/1.1
Host: 10.50.61.24
User-Agent: http-api/1.11
Content-Type: text/xml
SOAPAction: GIS20action/AWS_CALCULAR_IMPUESTOS.Execute
Expect: 100-continue
Content-Length: 978


recvresp(): entered
HTTP/1.1 100 Continue


SetError() Ñ13: HTTP/1.1 100 Continue
sendraw(): entered
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:gis="GIS20">
 <soapenv:Header/>
  <soapenv:Body>
   <gis:WS_Calcular_Impuestos.Execute>
     <gis:Request>
      <gis:TpoCbte>01</gis:TpoCbte>
      <gis:DocTpo>80</gis:DocTpo>
       <gis:DocNro>30567839377</gis:DocNro>
       <gis:TipoBien>0001</gis:TipoBien>
       <gis:CodConcepto>0001</gis:CodConcepto>
       <gis:CodJurEnt>0902</gis:CodJurEnt>
       <gis:ImporteSBT>63047.00</gis:ImporteSBT>
       <gis:ImporteDTOs>.00</gis:ImporteDTOs>
       <gis:MonCod>DOL</gis:MonCod>
       <gis:MonCot>3.0800</gis:MonCot>
       <gis:PagoGranos>0</gis:PagoGranos>
       <gis:EsDevolucion>0</gis:EsDevolucion>
       <gis:FechaOriginal>0000-00-00</gis:FechaOriginal>
       <gis:DevolucionParcial>0</gis:DevolucionParcial>
          </gis:Request>
       </gis:WS_Calcular_Impuestos.Execute>
    </soapenv:Body>
 </soapenv:Envelope>


recvresp(): entered
HTTP/1.1 200 OK
Date: Fri, 23 Oct 2009 20:18:56 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/xml;charset=utf-8
Content-Length: 4222


SetError() Ñ13: HTTP/1.1 200 OK
recvdoc parms: identity 4222
recvdoc(): entered
SetError() Ñ0:
<?xml version = "1.0" encoding = "utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
	<SOAP-ENV:Body>
		<WS_Calcular_Impuestos.ExecuteResponse xmlns="GIS20">
			<Request>
				<TpoCbte>1</TpoCbte>
				<DocTpo>80</DocTpo>
				<DocNro>30567839377</DocNro>
				<TipoBien>1</TipoBien>
				<CodConcepto>1</CodConcepto>
				<CodJurEnt>902</CodJurEnt>
				<ImporteSBT>63047.00</ImporteSBT>
				<ImporteDTOs>0.00</ImporteDTOs>
				<MonCod>DOL</MonCod>
				<MonCot>3.0800</MonCot>
				<PagoGranos>0</PagoGranos>
				<EsDevolucion>0</EsDevolucion>
				<FechaOriginal>0000-00-00</FechaOriginal>
				<DevolucionParcial>0</DevolucionParcial>
			</Request>
			<Messages>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>----------- Parametros ------------------------
PerCod: 41 - BIENId: 1 - CONCEPID: 1 - Dev: 0
Total_Fac: 63047.0000 - Desc: 0.0000 - Recargo: 0.0000

</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [901] Previa Tipo 3 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [902] Previa Tipo 2 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [915] Previa Tipo 1 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [904] Previa Tipo 1 --------------------------------
El coeficiente de la jurisdicción es menor al coeficiente del sujeto en jurisdicción
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [905] Previa Tipo 1 --------------------------------
El tipo de bien de la operacion está excluido (100%)
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [913] Previa Tipo 1 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [917] Previa Tipo 5 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [919] Previa Tipo 1 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [924] Previa Tipo 4 --------------------------------
No devolvio registros PERJUR
</ErrDetalle>
				</XML_Errores.Error>
				<XML_Errores.Error>
					<ErrCod>900</ErrCod>
					<ErrDescripcion>Error desconocido.</ErrDescripcion>
					<ErrDetalle>-- [921] Previa Tipo 6 --------------------------------
El Sujeto es Agente
</ErrDetalle>
				</XML_Errores.Error>
			</Messages>
			<Response>
				<XML_Impuestos_Calculados.Impuesto>
					<CodImpuesto>IVA</CodImpuesto>
					<TaxDescripcion>IVA</TaxDescripcion>
					<BasImponible>63047.00</BasImponible>
					<TaxAlic>10.5000</TaxAlic>
					<ImpuestoCalculado>6619.94</ImpuestoCalculado>
					<StringContable>08900000</StringContable>
				</XML_Impuestos_Calculados.Impuesto>
			</Response>
			<Error>OK</Error>
		</WS_Calcular_Impuestos.ExecuteResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

http_close(): entered
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------