Hub Nexus
작가아직 작성자가 없습니다맡기

개선할 점이 보이나요? 변경을 제안하세요.

후원

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.

이 페이지가 속한 매거진XForms

언어English

이용 허락: CC BY-SA 4.0 · 출처 en.wikibooks.org

1

0

0

0

Spinner Logo

코멘트

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