Author: keith
Date: Sun Jan 20 22:51:19 2008
New Revision: 12563
Log:
Removing some dodgy characters
Modified:
trunk/mashup/java/xdocs/wsrequesthostobject.html
Modified: trunk/mashup/java/xdocs/wsrequesthostobject.html
==============================================================================
--- trunk/mashup/java/xdocs/wsrequesthostobject.html (original)
+++ trunk/mashup/java/xdocs/wsrequesthostobject.html Sun Jan 20 22:51:19 2008
@@ -1,179 +1,288 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="content-type" content="">
- <title>WSRequest Host Object</title>
- <link href="styles.css" rel="stylesheet" type="text/css" media="all">
+
+ <meta http-equiv="content-type" content="">
+
+
+
+
+ <title>WSRequest Host Object</title>
+ <link href="styles.css" rel="stylesheet" type="text/css" media="all">
</head>
+
+
<body>
+
<div id="main-content">
<h1>WSRequest Host Object</h1>
+
<h3>1.0 Introduction</h3>
+
<p>The WSO2 Mashup Server automatically generates stubs to
- simplify the consumption of the Web Services it hosts.� But if you�re
- consuming a service from somewhere else, we don�t yet provide the same
level
- of ease.� Instead of a stub which hides some of the details of exercising
an
+ simplify the consumption of the Web Services it hosts. But if you're
+ consuming a service from somewhere else, we don't yet provide the same
level
+ of ease. Instead of a stub which hides some of the details of exercising an
operation, you must use the WSRequest object directly to formulate the
messages.</p>
+
<p>The WSRequest object is similar to the XMLHTTPRequest
- object.� It�s usage typically involves specifying the endpoint address and
+ object. It's usage typically involves specifying the endpoint address and
setting up options on how to frame the message, invoking the operation
with a
specific XML payload, and then checking and extracting information from the
result.</p>
+
<h3>1.1 Example</h3>
+
<div class="code">
- <pre>var version = new WSRequest();<br/>var options = new
Array();<br/>options.useSOAP = 1.2;<br/>options.useWSA =
1.0;<br/>options.action = "urn:getVersion";<br/>request =
"<getVersion/>";<br/><br/>try {<br/>
version.open(options,"http://127.0.0.1:11001/services/version", false);<br/>
version.send(request);<br/> result = version.responseE4X;<br/>} catch (e)
{<br/> print(e);<br/>}</pre>
+
+<pre>var version = new WSRequest();<br>var options = new
Array();<br>options.useSOAP = 1.2;<br>options.useWSA = 1.0;<br>options.action =
"urn:getVersion";<br>request = "<getVersion/>";<br><br>try {<br>
version.open(options,"http://127.0.0.1:11001/services/version", false);<br>
version.send(request);<br> result = version.responseE4X;<br>} catch (e)
{<br> print(e);<br>}</pre>
+
</div>
+
<h3>2.0 WSRequest Object</h3>
+
<h3>2.1 WSRequest Interface</h3>
+
<p>interface WSRequest
<br clear="all">
+
{
<br clear="all">
+
property EventListener onreadystatechange;
<br clear="all">
+
property unsigned short readyState;
<br clear="all">
+
void open ( in object options | in String method, in
String url [, in boolean async [, in String user [, in String
password]]]);
<br clear="all">
+
void send ( [in Document payload | in XMLString payload
| in XMLString
payload ]);
<br clear="all">
+
readonly property String responseText;
<br clear="all">
- readonly property Document responseXML;<br/>
- readonly property XML responseE4X;<br/>
- readonly property WebServiceError error;<br/>
+
+ readonly property Document responseXML;<br>
+
+ readonly property XML responseE4X;<br>
+
+ readonly property WebServiceError error;<br>
+
}</p>
+
<h3>2.2 API Documentation</h3>
-<table style="margin-left: 0.5in; border-collapse: collapse;"
class="MsoTableGrid" border="1"
- cellpadding="5" cellspacing="0">
+
+<table style="margin-left: 0.5in; border-collapse: collapse;"
class="MsoTableGrid" border="1" cellpadding="5" cellspacing="0">
+
<tbody>
+
<tr>
+
<td> Member</td>
+
<td> Description</td>
+
</tr>
+
<tr>
+
<td> open(options, endpointAddress, async)</td>
+
<td> This method prepares the WSRequest object to invoke a Web
service. It accepts
the following parameters: <br clear="all">
- <ul>
+
+
+ <ul>
+
<li><em>options (array)</em>: an array of options for
formulating the message. These options
correspond to the message
framing required by the service as documented in the
service's WSDL
and/or documentation. A list of the supported
options is at
- WSRequest Options. <br clear="all"></li>
+ WSRequest Options. <br clear="all">
+ </li>
+
<li><em>endpointAddress</em> (string): a URL representing
where to send the
- message. <br clear="all"></li>
+ message. <br clear="all">
+ </li>
+
<li><em>async</em> (boolean): a boolean flag representing
whether the operation
should be invoked asynchrounously or not. <br
clear="all">
+
The open() function throws an exception if the
WSRequest object cannot
accommodate the request (e.g., the options are
malformed.)
</li>
- </ul>
+
+
+ </ul>
+
</td>
+
</tr>
+
<tr>
+
<td> send(payload)</td>
+
<td> This method invokes the Web service with the requested
payload. <br clear="all">
- <ul>
+
+
+ <ul>
+
<li><em>payload</em>: an XML object or a string containing
the XML source for
the request.
</li>
- </ul>
+
+
+ </ul>
+
</td>
+
</tr>
+
<tr>
+
<td> onreadystatechange</td>
+
<td> This property can be set to a function
object, which is invoked when the state of an asynchronous
request
changes (e.g. the request completes).
</td>
+
</tr>
+
<tr>
+
<td> readyState</td>
- <td> The current state of the object, which can be one of the
following values: <br
- clear="all">
- <ul>
- <li>0: The object has not been initialized by calling the
open() method. <br
- clear="all"></li>
+
+ <td> The current state of the object, which can be one of the
following values: <br clear="all">
+
+
+ <ul>
+
+ <li>0: The object has not been initialized by calling the
open() method. <br clear="all">
+ </li>
+
<li>1: The object has been initialized successfully, but
the send() method has
- not been called. <br clear="all"></li>
- <li>2: The request is pending <br clear="all"></li>
+ not been called. <br clear="all">
+ </li>
+
+ <li>2: The request is pending <br clear="all">
+ </li>
+
<li>3: The request is partially complete (some data has
been received, and may
- be available in the responseText property. <br
clear="all"></li>
+ be available in the responseText property. <br
clear="all">
+ </li>
+
<li>4: The request is complete, all data has been
received. <br clear="all">
+
Of these, typically only the last (readyState == 4) is
used.
</li>
- </ul>
+
+
+ </ul>
+
</td>
+
</tr>
+
<tr>
+
<td> responseXML</td>
+
<td> The parsed XML message representing the
response from the service. (Currently this is same as
responseE4X, but
this will be fixed to return a DOM document in the future
versions)
</td>
+
</tr>
+
<tr>
+
<td> responseE4X</td>
+
<td> The parsed E4X XML message representing the response from the
service.</td>
+
</tr>
+
<tr>
+
<td> responseText</td>
+
<td> The raw text representing the XML (or
non-XML) response. If the responseXML property is empty,
you can
check the responseText property to see if a non-XML response
was
received.
</td>
+
</tr>
+
<tr>
+
<td> error</td>
+
<td> When an asynchronous operation failed to
complete successfully (including internal errors, or protocol
errors
such as SOAP faults) the error property is a WebServiceError
object
</td>
+
</tr>
- </tbody>
+
+
+ </tbody>
</table>
+
<h3>3.0 Options</h3>
-<table class="MsoTableGrid" style="margin-left: 0.5in; border-collapse:
collapse;" border="1"
- cellpadding="5" cellspacing="0">
+
+<table class="MsoTableGrid" style="margin-left: 0.5in; border-collapse:
collapse;" border="1" cellpadding="5" cellspacing="0">
+
<tbody>
+
<tr>
+
<td> Option</td>
+
<td> Range of values</td>
+
<td> Description</td>
+
</tr>
+
<tr>
+
<td> useSOAP</td>
+
<td><b>"1.2"</b>, 1.2, "1.1", 1.1, true, false</td>
+
<td> Indicates which version of SOAP to use. If
the value is "1.2", 1.2, or True, the message will be framed
as a SOAP
1.2 message. If "1.1" or 1.1, SOAP 1.1 will be used. If False,
the
@@ -181,55 +290,81 @@
correspond to the WSDL 2.0 SOAP 1.2 binding, and the WSDL 2.0
HTTP binding.
</td>
+
</tr>
+
<tr>
+
<td> useWSA</td>
+
<td> TRUE | FALSE | 1.0 | <b>"1.0"</b> | "submission"</td>
+
<td> Indicates whether to use WS-Addressing. If
TRUE, 1.0 or "1.0", WS-Addressing 1.0 is used. When
"submission" is
specified, the submitted version is used. Except when FALSE,
the
"action" must option must also be set.
</td>
+
</tr>
+
<tr>
+
<td> action</td>
+
<td> xs:anyURI</td>
+
<td> The WS-A action to use when constructing the
WS-A headers. Also used as the SOAP Action when specified,
regardless
of whether WS-A is engaged or not.
</td>
+
</tr>
+
<tr>
+
<td> HTTPMethod</td>
+
<td> xs:string | "POST"</td>
+
<td> The HTTP method to use to formulate the request.</td>
+
</tr>
- </tbody>
+
+
+ </tbody>
</table>
-<p>See <a
href="http://www.wso2.org/wiki/display/mashup/Ideas+for+evolving+WSRequest"
- title="Ideas for evolving WSRequest">Ideas for evolving
WSRequest</a> for additional
+
+<p>See <a
href="http://www.wso2.org/wiki/display/mashup/Ideas+for+evolving+WSRequest"
title="Ideas for evolving WSRequest">Ideas for evolving WSRequest</a> for
additional
options under development.</p>
+
<h3>4.0 References</h3>
+
<ul>
+
<li><a href="http://www.wso2.org/wiki/display/mashup/WebServiceError"
title="WebServiceError">WebServiceError</a>
</li>
- <li><span class="nobr"><a
-
href="http://www.wso2.org/wiki/pages/createpage.action?spaceKey=mashup&title=wsrequest_specification&linkCreation=true&fromPageId=888"
- title="Create Page: wsrequest_specification"
- class="createlink">wsrequest_specification</a></span></li>
+
+ <li><span class="nobr"><a
href="http://www.wso2.org/wiki/pages/createpage.action?spaceKey=mashup&title=wsrequest_specification&linkCreation=true&fromPageId=888"
title="Create Page: wsrequest_specification"
class="createlink">wsrequest_specification</a></span></li>
+
<li><a
href="apidocs/org/wso2/mashup/hostobjects/wsrequest/WSRequestHostImpl.html">JavaDoc
for
the WSRequest host Object</a></li>
+
<li><a
href="apidocs/org/wso2/mashup/hostobjects/wsrequest/WSRequestCallBack.html">JavaDoc
for
the WSRequestCallBack host Object</a></li>
+
<li><a
href="apidocs/org/wso2/mashup/hostobjects/wsrequest/WebServiceErrorHostObject.html">JavaDoc
for the WebServiceErrorHostObject host Object</a></li>
+
</ul>
+
</div>
-<p>© WSO2 Inc.</p>
+
+<p>� WSO2 Inc.</p>
+
</body>
-</html>
\ No newline at end of file
+</html>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev