|
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Ofsend is
orlando misas
Sent: Monday, September 18, 2017 9:39 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: HTTP/1.1 500 Internal Server Error
Hi,
When I consume a web services using httpapi and the xml structure I
less than 65000 bytes the process runs perfect; however when the fieldreturns
containing the xml structure is larger than 65000 bytes, the httpapi
the error 'HTTP / 1.1 500 Internal Server Error'. the definition ofthe field for
the first and second case is:65000
d soap s 65000 a (first case)
d soap s 200000 a (second case)
How do I set the field so I can send a larger frame of information to
bytes?xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">+
The program is as follows:
h dftactgrp (* no) bnddir ('HTTPAPI')
/copy HTTPAPI_H
D MapXmlData PR
D country 50a varying
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 65535A varying const
D attrs * dim(32767)
D const options(*varsize)
d VARYINGDATAOFFSET...
d c const(2)
d SOAP s 200000a
d TransaccionCrearResult...
D s 1000a varying
d wTimeOut s 10i 0
d wait s 1a
d rc s 10i 0
d cia s 2A
d Lote s 8A
d DocAceptacion s 7A
d Trabajo s 36A
d Aplicacion s 2A
d Ambiente s 1A
d Usuario s 10A
d ParAdicionales s 200000A
d Errores s 1000A
d Documentos s 1000A
d Conceptos s 1000A
C *Entry PList
C Parm CIA
C Parm Lote
C Parm DocAceptacion
C Parm Trabajo
C Parm Aplicacion
C Parm Ambiente
C Parm Usuario
C Parm ParAdicionales
C Parm Errores
C Parm Documentos
C Parm Conceptos
/free
SOAP = '<soap:Envelope +
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +
xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
<soap:Body>+<docaceptacion>'+%Trim(DocAceptacion)+'</docaceptacion>+
<TransaccionCadenasCrear xmlns="http://tempuri.org/">+
<ltParametros>'+
%Trim(ParAdicionales)+
'</ltParametros>+
<lote>'+%Trim(Lote)+'</lote>+
<trabajo>'+%Trim(Trabajo)+'</trabajo>+(RPG400-L)
<chraplicacion>'+%Trim(Aplicacion)+'</chraplicacion>+
<chrambiente>'+%Trim(Ambiente)+'</chrambiente>+
<chrusuario>'+%Trim(Usuario)+'</chrusuario>+
<cia>'+%Trim(Cia)+'</cia>+
<documentos></documentos>+
<conceptos></conceptos>+
</TransaccionCadenasCrear>+
</soap:Body>+
</soap:Envelope>';
http_setCCSIDs(1208: 0);
http_debug(*ON);
rc = http_post_xml( 'http://srvplantas.com/Aplicativos_I+
<http://srvplantasleo.leonisa.com/Aplicativos_I+>
nformaticos/WebServices/Service.asmx'
: %addr(SOAP) + VARYINGDATAOFFSET
: %len(SOAP)
: *NULL
: %paddr(MapXmlData)
: %addr(TransaccionCrearResult)
: wTimeOut
: HTTP_USERAGENT
: 'text/xml; charset=UTF-8');
if (rc<>1);
http_crash();
endif;
*inlr = *on;
/end-free
P MapXmlData B
D MapXmlData PI
D country 50a varying
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 65535A varying const
D attrs * dim(32767)
D const options(*varsize)
/free
if (name = 'TransaccionCadenasCrearResult');
errores = value;
endif;
if (name = 'documentos');
Documentos = value;
endif;
if (name = 'conceptos');
conceptos = value;
endif;
/end-free
P E
Thanks for the collaboration
Orlando Misas
omisas@xxxxxxxxx
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx Tosubscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.