Question How to export a string that contain xml to web-context?

Ithrees

New Member
Hi Folks,

I have a situation with my system.

After submitting a form, In the webobject I have this string variable that contains formatted xml value like,

Code:
myStr = '<?xml version="1.0" encoding="UTF-8"?>
        <record name="test">
          <field name="1stFld">Value1</field>
          <field name="2ndFld">Value2</field>
          <field name="3rdFld">Value</field>
        </record>'.

I need to upload this to the WEB-CONTEXT as an XML so some other services which expect and read the xml for its execution will use this.

like,

Code:
IF (WEB-CONTEXT:IS-XML) THEN
  RUN readAndXcute(output myHandle).

Please help me to define the proper work around for the above requirement.
Thank you in advance.
 

Stefan

Well-Known Member
web-context:is-xml is true when the received data is xml - to do this, your post needs to set the content-type on the request header to 'text/xml'.

You can then access the xml with the web-context:x-document handle.
 

Ithrees

New Member
web-context:is-xml is true when the received data is xml - to do this, your post needs to set the content-type on the request header to 'text/xml'.

You can then access the xml with the web-context:x-document handle.

Thank you for your replay Stefan,
In my case, I'm getting this xml string from a form submit.
Please clarify me if there anyway to set the content type before submit the form or after in the webobject...?

Thanks and Best Regards
 
Top