Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 71d40963b505df4524269198e237b3e3 > files > 1010

virtuoso-opensource-doc-6.1.4-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head profile="http://internetalchemy.org/2003/02/profile">
  <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" />
  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
  <meta name="dc.title" content="15. Web Services" />
  <meta name="dc.subject" content="15. Web Services" />
  <meta name="dc.creator" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" />
  <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="parent" href="webservices.html" title="Chapter Contents" />
  <link rel="prev" href="xmlxmla.html" title="XML for Analysis Provider" />
  <link rel="next" href="syncml.html" title="SyncML" />
  <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="doc.css" />
  <link rel="stylesheet" type="text/css" href="/doc/translation.css" />
  <title>15. Web Services</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
  <meta name="author" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="copyright" content="OpenLink Software, 1999 - 2009" />
  <meta name="keywords" content="" />
  <meta name="GENERATOR" content="OpenLink XSLT Team" />
 </head>
 <body>
  <div id="header">
    <a name="xmlrpc" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>15. Web Services</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="webservices.html">Chapter Contents</a> | <a class="link" href="xmlxmla.html" title="XML for Analysis Provider">Prev</a> | <a class="link" href="syncml.html" title="SyncML">Next</a>
   </div>
  </div>
  <div id="currenttoc">
   <form method="post" action="/doc/adv_search.vspx">
    <div class="search">Keyword Search: <br />
        <input type="text" name="q" /> <input type="submit" name="go" value="Go" />
    </div>
   </form>
   <div>
      <a href="http://www.openlinksw.com/">www.openlinksw.com</a>
   </div>
   <div>
      <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a>
   </div>
    <br />
   <div>
      <a href="index.html">Book Home</a>
   </div>
    <br />
   <div>
      <a href="contents.html">Contents</a>
   </div>
   <div>
      <a href="preface.html">Preface</a>
   </div>
    <br />
   <div class="selected">
      <a href="webservices.html">Web Services</a>
   </div>
    <br />
   <div>
      <a href="soap.html">SOAP</a>
   </div>
   <div>
      <a href="wsdl.html">WSDL</a>
   </div>
   <div>
      <a href="vfoafssl.html">WebID Protocol Support</a>
   </div>
   <div>
      <a href="voauth.html">OAuth Support</a>
   </div>
   <div>
      <a href="vwsssupport.html">WS-Security (WSS) Support in Virtuoso SOAP Server</a>
   </div>
   <div>
      <a href="ws-routing.html">Web Services Routing Protocol (WS-Routing)</a>
   </div>
   <div>
      <a href="warm.html">Web Services Reliable Messaging Protocol (WS-ReliableMessaging)</a>
   </div>
   <div>
      <a href="vwstrust.html">Web Services Trust Protocol (WS-Trust)</a>
   </div>
   <div>
      <a href="xmlxmla.html">XML for Analysis Provider</a>
   </div>
   <div class="selected">
      <a href="xmlrpc.html">XML-RPC support</a>
   </div>
   <div>
      <a href="syncml.html">SyncML</a>
   </div>
   <div>
      <a href="uddi.html">UDDI</a>
   </div>
   <div>
      <a href="expwsmodules.html">Exposing Persistent Stored Modules as Web Services</a>
   </div>
   <div>
      <a href="vsmx.html">Testing Web Published Web Services</a>
   </div>
   <div>
      <a href="bpel.html">BPEL Reference</a>
   </div>
   <div>
      <a href="xsql.html">XSQL</a>
   </div>
    <br />
  </div>
  <div id="text">
    <a name="xmlrpc" />
    <h2>15.10. XML-RPC support</h2>

<p>The XML-RPC is a remote procedure calling system via
HTTP using XML as the encoding. It is very much like the SOAP protocol,
but the data encoding rules are different.
XML-RPC supports fewer data types than SOAP. The data is self-describing and
position bound. </p>

<p>The Virtuoso SOAP server can process XML-RPC requests using the
XML-RPC to SOAP bridge. This is done with two filters : input and output filter.
The input filter transforms XML-RPC into a SOAP PRC encoded message.  Then the
transformed message is passed to the SOAP server for processing.
The response from the SOAP server will be re-coded into XML-RPC format in the
output filter. The combination of these filters constitutes the bridge.</p>

<p>It is important to remember that XML-RPC defines two complex
types : array and structure. These two types are represented by vector () and
soap-structure respectively, when passing the data to the PL procedure in question.</p>

<a name="ex_xmlrpc" />
    <div class="example">
      <div class="exampletitle">XML-RPC Procedure Definition</div>
<p>An example of a PL procedure representing an
XML-RPC method &quot;echoXRtypes&quot; is:</p>

<div>
        <pre class="programlisting">
create procedure echoXRtypes (
                                in  inInteger 	integer,
                                in  inString 	varchar,
                                in  inDate 	datetime,
                                in  inDouble 	double precision,
				in  inBoolean 	smallint,
				in  inHex 	varchar,
                                out outInteger 	integer,
                                out outString 	varchar,
                                out outDate 	datetime,
                                out outDouble 	double precision,
				out outBoolean 	smallint,
				out outHex 	varchar __soap_type &#39;http://www.w3.org/2001/XMLSchema:base64Binary&#39;
 			    )
{
    outInteger  := inInteger 	;
    outString 	:= inString 	;
    outDate 	:= inDate 	;
    outDouble 	:= inDouble 	;
    outBoolean 	:= soap_boolean (inBoolean);
    outHex 	:= inHex 	;
}
;
</pre>
      </div>

<p>Note that the definition of such procedures does not differ from those
of SOAP procedures.</p>

<p>An XML-RPC request may look like:</p>

<div>
        <pre class="programlisting">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;methodCall&gt;
&lt;methodName&gt;echoXRtypes&lt;/methodName&gt;
&lt;params&gt;
  &lt;param&gt; &lt;value&gt;&lt;i4&gt;42&lt;/i4&gt;&lt;/value&gt; &lt;/param&gt;
  &lt;param&gt; &lt;value&gt;String&lt;/value&gt; &lt;/param&gt;
  &lt;param&gt; &lt;value&gt;&lt;dateTime.iso8601&gt;1998-07-17T14:08:55&lt;/dateTime.iso8601&gt;&lt;/value&gt; &lt;/param&gt;
  &lt;param&gt; &lt;value&gt;&lt;double&gt;1234.567&lt;/double&gt;&lt;/value&gt; &lt;/param&gt;
  &lt;param&gt; &lt;value&gt;&lt;boolean&gt;1&lt;/boolean&gt;&lt;/value&gt; &lt;/param&gt;
  &lt;param&gt; &lt;value&gt;&lt;base64&gt;eW91IGNhbid0IHJlYWQgdGhpcyE=&lt;/base64&gt;&lt;/value&gt; &lt;/param&gt;
&lt;/params&gt;
&lt;/methodCall&gt;
</pre>
      </div>

<p>The response for the above message will be :</p>

<div>
        <pre class="programlisting">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;methodResponse&gt;
&lt;params&gt;
&lt;param&gt; &lt;value&gt; &lt;i4&gt;42&lt;/i4&gt; &lt;/value&gt; &lt;/param&gt;
&lt;param&gt; &lt;value&gt; &lt;string&gt;String&lt;/string&gt; &lt;/value&gt; &lt;/param&gt;
&lt;param&gt; &lt;value&gt; &lt;dateTime.iso8601&gt;1998-07-17T14:08:55.000+03:00&lt;/dateTime.iso8601&gt; &lt;/value&gt; &lt;/param&gt;
&lt;param&gt; &lt;value&gt; &lt;double&gt;1234.567000&lt;/double&gt; &lt;/value&gt; &lt;/param&gt;
&lt;param&gt; &lt;value&gt; &lt;boolean&gt;1&lt;/boolean&gt; &lt;/value&gt; &lt;/param&gt;
&lt;param&gt; &lt;value&gt; &lt;base64&gt;eW91IGNhbid0IHJlYWQgdGhpcyE=&lt;/base64&gt; &lt;/value&gt; &lt;/param&gt;
&lt;/params&gt;
&lt;/methodResponse&gt;
</pre>
      </div>
</div>

<p>Enabling the XML-RPC -&gt; SOAP bridge is very simple.  You make a
virtual directory with physical location pointing to /SOAP/ and specify the &#39;XML-RPC&#39;
SOAP option as &#39;yes&#39;.  The following methods are available:</p>

<ol>
    <li>
        <div class="formalpara">
          <strong>Virtual Directories Visual Administration Interface</strong>
  <p>From the main administration menu go to
  <span class="computeroutput">Web Servers -&gt; Virtual Directories</span> and add
  or configure a virtual directory.  For the directory definition add a new option in
  SOAP options box: &quot;<span class="computeroutput">XML-RPC=yes;</span>&quot;.</p>
  </div>
    </li>
      <li>
        <div class="formalpara">
          <strong>The vhost_define() Function</strong>
  <p>Using the ISQL utility one can use the command:</p>
  </div>
  <div>
          <pre class="programlisting">
SQL&gt; vhost_define (lpath=&gt;&#39;/RPC2&#39;, ppath=&gt;&#39;/SOAP/&#39;, soap_user=&gt;&#39;dba&#39;,
    soap_opts=&gt;vector (&#39;XML-RPC&#39;, &#39;yes&#39;));
</pre>
        </div>
</li>
    </ol>

<div class="note">
      <div class="notetitle">Note:</div>
  <p>Virtual directories configured in this way can only be used for
  XML-RPC calls. If you need to make SOAP requests, then another virtual
  directory will be required.</p>
    </div>
<table border="0" width="90%" id="navbarbottom">
    <tr>
        <td align="left" width="33%">
          <a href="xmlxmla.html" title="XML for Analysis Provider">Previous</a>
          <br />XML for Analysis Provider</td>
     <td align="center" width="34%">
          <a href="webservices.html">Chapter Contents</a>
     </td>
        <td align="right" width="33%">
          <a href="syncml.html" title="SyncML">Next</a>
          <br />SyncML</td>
    </tr>
    </table>
  </div>
  <div id="footer">
    <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div>
   <div id="validation">
    <a href="http://validator.w3.org/check/referer">
        <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" />
    </a>
    <a href="http://jigsaw.w3.org/css-validator/">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" />
    </a>
   </div>
  </div>
 </body>
</html>