Hub Nexus
Aggiornato

AutoreAncora senza autorePrendila in carico

Vedi qualcosa da migliorare? Proponi una modifica.

Sostegno

Motivation

You want a generic tool for testing a REST web service. You want to be able to put in a URI and an instance document and see what data is returned.

Screen Images

before submission (Image: The original uploader was Dmccreary at English Wikibooks ., CC BY-SA 3.0)

after submission (Image: The original uploader was Dmccreary at English Wikibooks ., CC BY-SA 3.0)

Source Code

xmlns="http://www.w3.org/1999/xhtml"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xf="http://www.w3.org/2002/xforms">;

REST Service Tester
type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
body {font-family: Ariel,Helvetica,sans-serif;}
.header {font-weight: bold;}
xf|group {border: black solid 1px; padding:10px; margin: 15px 5px;}
.group-label {display:block; position:relative; font-weight:bold;font-size:12pt;
background-color: silver; margin: 3px; width: 30%;
padding: 2px 4px; top: -20px; left: -3px;}
.url .xf-value {width: 100%;}

id="atomFeed">
xmlns="http://www.w3.org/2005/Atom">;
Atom Feed

id="resource">
xmlns="">
http://xformstest.org/cgi-bin/echo.sh

xmlns="" id="messages">

id="submit" replace="none" ref="instance('atomFeed')" method="post"
mediatype="application/atom+xml">
value="instance('resource')/resource"/>
ev:event="xforms-submit-error">
ref="instance('messages')/xforms-submit-error/error-type"
value="event('error-type')"/>
ref="instance('messages')/xforms-submit-error/resource-uri"
value="event('resource-uri')"/>
ref="instance('messages')/xforms-submit-error/response-status-code"
value="event('response-status-code')"/>
ref="instance('messages')/xforms-submit-error/response-headers"
value="event('response-headers')"/>

ref="instance('messages')/xforms-submit-error/response-reason-phrase"
value="event('response-reason-phrase')"/>
ref="instance('messages')/xforms-submit-error/response-body"
value="event('response-body')"/>

ev:event="xforms-submit-done">
ref="instance('messages')/xforms-submit-done/resource-uri"
value="event('resource-uri')"/>
ref="instance('messages')/xforms-submit-done/response-status-code"
value="event('response-status-code')"/>
nodeset="instance('messages')/xforms-submit-done/response-headers"
origin="event('response-headers')"/>

ref="instance('messages')/xforms-submit-done/response-reason-phrase"
value="event('response-reason-phrase')"/>

class="header">XForms Service Tester

ref="instance('resource')">
class="group-label">Submission Data
class="prompt-nl">Enter the web address (URL) to which you would like to submit the instance:
ref="resource" class="url"/>

ref="instance('messages')/xforms-submit-error">
class="group-label">Error Messages
ref="error-type">

value="name(.)"/>

ref="resource-uri">

value="name(.)"/>

ref="response-status-code">

value="name(.)"/>

ref="response-headers">

value="name(.)"/>

ref="response-reason-phrase">

value="name(.)"/>

ref="response-body">

value="name(.)"/>

ref="instance('messages')/xforms-submit-done">
class="group-label">Submit Done Messages
ref="resource-uri">

value="name(.)"/>

ref="response-status-code">

value="name(.)"/>

ref="response-headers">
class="group-label">
value="name(.)"/>

nodeset="../header">
ref="./value">
ref="../name"/>:

ref="response-reason-phrase">

value="name(.)"/>

ev:event="DOMActivate" submission="submit">
Submit

Discussion

The response area could be hidden in a switch/case view and a toggle done after submission.

Acknowledgments

Thanks to Fraser for this suggestion.

Where this page came from

This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

In queste pubblicazioniXForms

LingueEnglish

Licenza: CC BY-SA 4.0 · Tratto da en.wikibooks.org

1

0

0

0

Spinner Logo

Commenti

Spinner Logo
Versione: 2CC0 1.0 — public domain
The runaway star that left the Tarantula Nebula
Versione: 2CC0 1.0 — public domain
The Blackwell School, where segregation had no law behind it
Versione: 2CC0 1.0 — public domain
The Eagle Nebula, seen in the infrared
Versione: 2CC0 1.0 — public domain
The house where the Equal Rights Amendment was written
Versione: 2CC0 1.0 — public domain
The Aleutians, the forgotten front of the Second World War
Versione: 2CC0 1.0 — public domain
The Cosmic Cliffs are not cliffs