Stu,
I forgot to mention what you might expect back in the response and headers 
fields. The response will
contain whatever the web service you are posting to/requesting from is 
programmed to respond with.
In the case of a web service, for example, it will probably return an XML 
document. In the case of a
web site it may return whatever exists at that URL eg html or possibly a zip or 
doc file for
example. If you get something like this in your response, the http Headers 
should contain the mime
type and other info about the document.
Generally, it will then be up to you to handle and process the file with 
whichever tools you
determine are appropriate. Generally I think most web protocols will do some 
form of ascii encoding
(b64/uucp/etc) to ensure that the file is web safe. If you receive the file in 
this way then you
have to uncompress/uuucp/b64 it. Otherwise, if the file is potentially binary 
then you need to
handle it more delicately with UV as writes, for example, can munge the file. 
Also, the potential
size of a file could be an issue.
HTH
Stuart Boydell



From: Stuart.Boydell
This shows how to post a simple (xml) purchase order to a web service -
response contained in 'response'.

program TEST.POST
equ E.THIS.PROG to 'TEST.POST'
equ E.URL to 'http://10.1.1.123/eprocurement.aspx'
equ E.POST to 'POST:text/xml' ;*// note mime type is possibly optional
sessionHandle = ''
httpHeaders = ''
httpStatus = ''
postData = '< ns0:PO xmlns:ns0="http://HTTPRequestResponse.POSchema";>< 
Item>Item01< /Item><
Price>500< /Price>< /ns0:PO>'
if not(createRequest(E.URL,E.POST,sessionHandle)) then
crt 'return
status=':submitRequest(sessionHandle,60000,postData,httpHeaders,response 
,httpStatus)
end
crt 'httpStatus=':httpStatus
crt 'httpHeaders=':httpHeaders
crt 'response=':response
the:end

Stuart Boydell
_______________________________
From: Stu Glancy
Does anyone have any examples of using callHTTP to GET and/or POST.
I'm in the early stages of figuring out how to use callHTTP and have had
some success in being able to GET but it's only html that comes back. I
need examples of GETting a file or POSTing a file. Any help would be
appreciated.


 
**********************************************************************
This email message and any files transmitted with it are confidential and 
intended solely for the use of addressed recipient(s). If you have received 
this communication in error, please reply to this e-mail to notify the sender 
of its incorrect delivery and then delete it and your reply.  It is your 
responsibility to check this email and any attachments for viruses and defects 
before opening or sending them on. Spotless collects information about you to 
provide and market our services. For information about use, disclosure and 
access, see our privacy policy at http://www.spotless.com.au 
Please consider our environment before printing this email. 
********************************************************************** 
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to