A 500 code comes from the server, not HTTPAPI. There should, if the
server is decent, be more information after the 500 error telling
exactly what it doesn't like. If not, you need to contact the web
service provider to see what the real issue is.




Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
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
send is
less than 65000 bytes the process runs perfect; however when the field
containing the xml structure is larger than 65000 bytes, the httpapi
returns
the error 'HTTP / 1.1 500 Internal Server Error'. the definition of
the field for
the first and second case is:
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
65000
bytes?

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"; +

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>+
<soap:Body>+
<TransaccionCadenasCrear xmlns="http://tempuri.org/";>+
<ltParametros>'+
%Trim(ParAdicionales)+
'</ltParametros>+
<lote>'+%Trim(Lote)+'</lote>+

<docaceptacion>'+%Trim(DocAceptacion)+'</docaceptacion>+
<trabajo>'+%Trim(Trabajo)+'</trabajo>+
<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)
(RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe,
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

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].