Kbase P45288: How to verify if a document POSTed to a Webspeed Transaction Server is XML ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/13/2010 |
|
Status: Verified
GOAL:
How to verify if a document POSTed to a Webspeed Transaction Server is XML ?
GOAL:
How to POST xml to webspeed using telnet
FACT(s) (Environment):
Webspeed 3.1x
All Supported Operating Systems
OpenEdge 10.x
FIX:
With following code you can check whether the posted data is valid XML or not:
DEF VAR hDoc AS WIDGET-HANDLE.
IF REQUEST_METHOD = "POST"
AND WEB-CONTEXT:IS-XML
AND WEB-CONTEXT:X-DOCUMENT <> ?
THEN
hDoc = WEB-CONTEXT:X-DOCUMENT.
{&OUT} (IF WEB-CONTEXT:IS-XML THEN "WEB-CONTEXT IS XML"
ELSE "WEB-CONTEXT IS NOT XML") "<BR>".
{&OUT} (IF WEB-CONTEXT:X-DOCUMENT = ? THEN "WEB-CONTEXT:X-DOCUMENT = ?"
ELSE "WEB-CONTEXT:X-DOCUMENT <> ?") "<BR>".
To test the above code, you can use telnet to post an XML fragment to the WebSpeed:
1. Open a telnet sesion using the following connection:
TELNET HOSTNAME 80 (<- webserver portnumber)
2. POST the XML file :
POST /scripts/cgiip.exe/WService=wsbroker1/procedur.p
Content-type: text/xml
Content-lenght: XX (<- file size in KB)
<?xml version="1.0" encoding="utf-8" ?>
<test></test>