You need to send a line with a carriage return between your headers and the body.
Matt
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of balasubramanian.p.sundaram@xxxxxxxxxxxxx
Sent: Monday, January 28, 2008 9:52 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: XML request
All,
Can you please look at the piece of code...
Client Request:
C eval request = 'POST '+ %trim(file) +
C ' HTTP/1.1' + x'0D25'
C exsr sendDta
C eval request = 'Host: ' + %trim(host) +
C x'0D25'
C exsr sendDta
C eval request='Content-Type: multipart/form-dat
C 'boundary=' +
C 'AaB03x' +
C x'0D25'
C exsr sendDta
C eval request = 'Content-Length: 59' + x'0D25'
C exsr sendDta
C eval request ='--AaB03x' + x'0D25'
C exsr sendDta
C eval request = 'Content-Disposition: '+
C 'form-data; name='+'"version"'+
C x'0D25'
C exsr sendDta
C eval request ='--AaB03x' + x'0D25'
C exsr sendDta
C eval request = 'Content-Disposition:'+
C ' form-data; name='+
C ' "forx"' + x'0D25'
C exsr sendDta
C eval request = 'Content-Type: text/xml;' +
C ' charset= utf-8, boundary = BbC04y' +
C x'0D25'
C exsr sendDta
C eval request ='--BbC04y' + x'0D25'
C exsr sendDta
C eval request = 'Content-Disposition:'+
C ' attachment; filename = ' +
C '"/bala/test.xml"' +
C x'0D25'+ x'0D25'
C exsr sendDta
C exsr sendFile (Reading IFS file and send thro
socket)
C eval request = x'0D25'
C exsr sendDta
In sendDta is converting ascii to ebcdic format and write thro socket.
Response from the server
HTTP/1.1 400 Bad Request
Date: Mon, 28 Jan 2008 14:16:28 GMT
Server: Apache
Content-Length: 302
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
<P>Your browser sent a request that this server could not understand. <BR
/>
Request header field is missing ':' separator.<br/>
<pre>
--AaB03x</pre>
</P>
</body></html>
XML File
<?xml version="1.0" encoding="utf-8"?><ReqMsg>Z</ReqMsg>
What could be the problem? I'm trying for the past two days... Help
Plz....
Regards
Balasubramanian PS
-------------------------------------------------------------------------------------------------------------------
Dream!!! is not what you see in sleep.... is the thing which does not let
you sleep
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.