Testing Code In The Browser - MACROMEDIA BREEZE 5 Integration Manual

Hide thumbs Also See for BREEZE 5:
Table of Contents

Advertisement

Testing code in the browser

You can enter a test URL in the address field of a browser window and see the XML response
from the server. It is a good idea to become comfortable with filters in the browser before you
write code.
There are many nuances to filters that determine which types of filters you can use with certain
API calls. The browser approach lets you quickly try combinations to see what works and what
doesn't. If you try this outside the browser, you add the extra time of compiling, loading the result
in your application server, and debugging to see if a filter works as you expect. Using a browser,
on the other hand, is much faster and gives you immediate feedback.
For example, you could use the following URL and filter to find all courses with the word filter in
the name and the word date in the course description. This sample URL uses
breezedev.mycompany.com
then enter the following URL, substituting your server name for
http://breezedev.mycompany.com/api/xml?action=report-my-courses&filter-like-
name=filter&filter-like-description=date
The result in the browser should look similar to the following:
<?xml version="1.0" encoding="utf-8" ?>
<results>
<status code="ok" />
<my-courses>
<course sco-id="2649026" status="active" type="course">
<name>Understanding Filters Part 2</name>
<description>Second course in the series, covering important topics such
as date and range filtering.</description>
<url>admin.ibreeze.macromedia.com/p40583853/</url>
<date-created>2004-05-26T17:51:40.840-07:00</date-created>
<date-modified>2004-05-26T17:51:47.750-07:00</date-modified>
<date-begin>2004-05-24T14:00:00.000-07:00</date-begin>
<url-path>/p40583853/</url-path>
<expired>false</expired>
</course>
</my-courses>
</results>
If your filters are too stringent and no courses meet your criteria, the output looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<results>
<status code="ok" />
<my-meetings />
</results>
Finally, as you experiment with filters and APIs in the browser, you might get an unexpected
response. For example, if you enter the wrong filter field name, which matches some other item in
the database, you could receive an XML response that starts with the following:
<?xml version="1.0" encoding="utf-8" ?>
<results>
<status code="internal-error">
as the server name. Make sure you log on to the server first, and
breezedev.mycompany.com
Testing code in the browser
:
25

Advertisement

Table of Contents
loading

Table of Contents