XML Proxy
Executes a proxy command to another server. This transaction is implemented to support cross-domain calls by a client. Due to security restrictions, a client cannot send a transaction to another server. Instead, this work is delegated to the server. The server receives an XML POST transaction from a client. The header contains the URL, additional connection parameters, and the XML body to send to the server. The server sends the XML and returns whatever comes back.
Example API call
/servlets3/wietmsd?id=1509040645488&date=135132123123&target=utility&action=proxy
Parameters
| Parameter | Description |
|---|---|
target | utility |
action | proxy |
id | A session ID that was retrieved with or without a specific collection and publication combination |
date | To prevent browser-side caching of data, especially with AJAX requests, it is important to make a URL unique. The most effective technique to accomplish this is to include a date parameter that is based on the time at which the call is made. |
XML post data
This API call requires XML post data to complete. An example of that XML data is given here. The client forms XML post data that includes all the information about the HTTP request that should be forwarded through the proxy. This includes the target URL for the request (in <target-url/>) , and any XML data that should be sent to the URL on the far side (in <request-body/>). All XML Proxy requests are made as HTTP requests with method of POST.
<request>
<target-url>http://livecontent.updateserver.com/ContentaViewUpdateServer/PrepareUpdates.do</target-url>
<request-body>
<update hostid="w4thasdf2324tsiofns" date="02/22/2007" uname="guest" password="" />
</request-body>
</request>
Returns
- On success
-
If the XML Proxy operation is successful, a
<result/>element will be returned with a@status="SUCCESS"attribute. The return value of the HTTP post request is placed within the<result/>element. This may be simple text, XHTML, or XML content. Non-valid XML or HTML content that cannot parse as XML content will cause the XML Proxy API call to fail, as its return is valid XML content. An example return follows. The second<result/>element in this example is returned by the service (LiveContent Update Server) that was contacted.<result status="SUCCESS" > <result status="SUCCESS" cookie="sdfjasdfDZFSF^%$SAF0qi8q7wft" >Login successful.</result> </result> - On failure
-
If the XML Proxy operation fails, a
<result/>element with a@status="FAIL"will be returned, including a@messageattribute.<result status="FAIL" message="Unable to connect." />