W3C home > Mailing lists > Public > www-lib@w3.org > April to June 2001

Document Data in POST being lost.

From: Mike Bytnar <mbytnar@auvo.com>
Date: Wed, 09 May 2001 15:17:57 -0500
Message-ID: <3AF9A5F5.BA3D93DE@auvo.com>
To: www-lib@w3.org
CC: Anton Belov -- Customer Engineering <antonb@scot.canada.sun.com>
Document data set for a HTAnchor does not appear in the data sent over
the socket.
The headers are correct. However, the data set with
HTAnchor_setDocument() is never posted to the remote server (see the
trace ouput below). The "189 bytes written" accounts for only the length
of the header data.

It appears that the document data is recognized, since the
"Content-Length" header appears in the message.
Why is the document data not written to the socket right after the
header?

Have I progmatically missed something?

Regards,
--Mike

For more information... I am attempting to post the below string as the
lpOptional parameter below. It has a length of 216 bytes.

char * lpOptional = "<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>GeneralSubmissionMgr.getRequestKey</methodName>
<params>
<param><value><string>testing@myclient</string></value></param>
</params>
</methodCall>";
int dwOptionalLength = strlen(lpOptional);

First, create an anchor, and add extra headers.
Then:
    HTAnchor_setDocument(src_anchor, (char *)lpOptional);
    HTAnchor_setLength(src_anchor, dwOptionalLength);
    HTAnchor_setFormat(src_anchor, WWW_PLAINTEXT);
    HTPostAnchor(src_anchor, dst_anchor, request);

Now, when the request finally makes through to HTWriter.c, the trace log
shows:

[...]
  HTTP........ Generating HTTP/1.x Request Headers
  HTTP........ Generating General Headers
  MIME........ Generating Entity Headers
  Buffer...... Flushing e3010
  Writing to socket 5
  POST /RPC2 HTTP/1.1
  Host: localhost:8092
  Date: Wed, 09 May 2001 21:43:56 GMT
  content-type:  text/xml
  User-Agent: XML-RPC C Test Client
  Content-Length: 216
  Content-Type: text/plain
  
  Write Socket 189 bytes written to 5
[...end of log]
Received on Wednesday, 9 May 2001 16:18:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:39 GMT