From: David B. <bd...@us...> - 2003-05-29 00:55:38
|
Jay, The error message in the result buffer is from the HTTP service (when it parses the incoming command). However, it should be returning a RC 7 "Invalid request string" (and looking at the code, I don't see any problems). Maybe if you send your C++ code we can figure out what's going on. You can wrapper the CONTENT information by using the wrapData function (you might have to escape the quotation marks): static STAFString wrapData(const STAFString &data); You can do something like: STAFString contentData("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><licenses>......</licenses>"); STAFResultPtr result = handle->submit("LOCAL", "HTTP", "REQUEST METHOD POST URL http://155.64.27.66/Sign HEADER Content-Type=application/xml RETURNHEADERS CONTENT " + STAFHandle::wrapData(contentData)); cout << "HTTP REQUEST RC: " << result->rc << ", Result: " << result->result << endl; David Bender STAF/STAX Development 8-1268 (512-838-1268) IBM Austin Bldg. 903-4B000 Internet: bd...@us... |---------+--------------------------------------> | | "Jay VanSant" | | | <jva...@sy...> | | | Sent by: | | | sta...@li...ur| | | ceforge.net | | | | | | | | | 05/28/2003 06:50 PM | | | | |---------+--------------------------------------> >-----------------------------------------------------------------------------------------------------------| | | | To: sta...@li... | | cc: | | Subject: [staf-users] STAF HTTP service question | | | >-----------------------------------------------------------------------------------------------------------| I'm trying to use the STAF HTTP service for the first time. The syntax for a reqeust is shown in the HTTP service documentation to be: REQUEST METHOD <http_method> URL <target_url> [CONTENT <content>] [HEADER <key1=value1> [...]] [FILE <output_filename>] [IGNOREERRORS] [NOSTATUS] [RETURNHEADERS] The following log output shows the request string and the result: INFO: Sending STAF LOCAL HTTP REQUEST METHOD POST URL http://155.64.27.66/Sign HEADER Content-Type=application/xml RETURNHEADERS CONTENT <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <licenses> ...... (shortened to simplify this email) </licenses> ERROR: STAF HTTP POST of xml file failed, rc: 1 INFO: RESULT BUFFER: INFO: You may have no more than 0 argument(s). You specified 22 argument(s). T he first excess argument is, version=1.0. I am submitting this within a C++ method. The CONTENT I wish to POST is a multiline XML document. As a string, it includes quotation marks, newline characters, etc. My questions are: Is the error message in the result buffer from the STAF HTTP service? Is there some way I need to enclose the CONTENT argument so that it will correctly pass the whole thing to the Web Server? According to the error table (in the STAF User's Guide), the return code of 1 means "Invalid API", and suggests reporting it to the authors. Thanks, Jay VanSant Symantec Corp. ------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ staf-users mailing list sta...@li... https://lists.sourceforge.net/lists/listinfo/staf-users |