您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

157 行
8.1 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>webservice — Remote Framework Access via HTTP &mdash; Documentation</title>
  7. <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '',
  13. COLLAPSE_MODINDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/doctools.js"></script>
  20. <link rel="top" title="Documentation" href="index.html" />
  21. <link rel="up" title="3. Server Side API" href="server_side_api.html" />
  22. <link rel="next" title="Server Side Internals" href="server_side_internals.html" />
  23. <link rel="prev" title="profile — Profile" href="profile.html" />
  24. </head>
  25. <body>
  26. <div style="background-color: #FFF; text-align: left; padding: 8px 0px"><img src="_static/banner300910.gif"></div>
  27. <div class="related">
  28. <h3>Navigation</h3>
  29. <ul>
  30. <li class="right" style="margin-right: 10px">
  31. <a href="genindex.html" title="General Index"
  32. accesskey="I">index</a></li>
  33. <li class="right" >
  34. <a href="modindex.html" title="Global Module Index"
  35. accesskey="M">modules</a> |</li>
  36. <li class="right" >
  37. <a href="server_side_internals.html" title="Server Side Internals"
  38. accesskey="N">next</a> |</li>
  39. <li class="right" >
  40. <a href="profile.html" title="profile — Profile"
  41. accesskey="P">previous</a> |</li>
  42. <li><a href="index.html">Documentation</a> &raquo;</li>
  43. <li><a href="server_side_api.html" accesskey="U">3. Server Side API</a> &raquo;</li>
  44. </ul>
  45. </div>
  46. <div class="sphinxsidebar">
  47. <div class="sphinxsidebarwrapper">
  48. <h3><a href="index.html">Table Of Contents</a></h3>
  49. <ul>
  50. <li><a class="reference external" href=""><tt class="docutils literal"><span class="pre">webservice</span></tt> &#8212; Remote Framework Access via HTTP</a><ul>
  51. <li><a class="reference external" href="#framework-server-class">Framework Server Class</a></li>
  52. <li><a class="reference external" href="#example">Example</a></li>
  53. </ul>
  54. </li>
  55. </ul>
  56. <h4>Previous topic</h4>
  57. <p class="topless"><a href="profile.html"
  58. title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">profile</span></tt> &#8212; Profile</a></p>
  59. <h4>Next topic</h4>
  60. <p class="topless"><a href="server_side_internals.html"
  61. title="next chapter">Server Side Internals</a></p>
  62. <h3>This Page</h3>
  63. <ul class="this-page-menu">
  64. <li><a href="_sources/webservice.txt"
  65. rel="nofollow">Show Source</a></li>
  66. </ul>
  67. <div id="searchbox" style="display: none">
  68. <h3>Quick search</h3>
  69. <form class="search" action="search.html" method="get">
  70. <input type="text" name="q" size="18" />
  71. <input type="submit" value="Go" />
  72. <input type="hidden" name="check_keywords" value="yes" />
  73. <input type="hidden" name="area" value="default" />
  74. </form>
  75. <p class="searchtip" style="font-size: 90%">
  76. Enter search terms or a module, class or function name.
  77. </p>
  78. </div>
  79. <script type="text/javascript">$('#searchbox').show(0);</script>
  80. </div>
  81. </div>
  82. <div class="document">
  83. <div class="documentwrapper">
  84. <div class="bodywrapper">
  85. <div class="body">
  86. <div class="section" id="module-webservice">
  87. <h1><tt class="xref docutils literal"><span class="pre">webservice</span></tt> &#8212; Remote Framework Access via HTTP<a class="headerlink" href="#module-webservice" title="Permalink to this headline">¶</a></h1>
  88. <div class="section" id="framework-server-class">
  89. <h2>Framework Server Class<a class="headerlink" href="#framework-server-class" title="Permalink to this headline">¶</a></h2>
  90. <p>..class:: FrameworkServer(remote_host, path, user=&#8217;&#8216;, password=&#8217;&#8216;, account=&#8217;&#8216;, cookies={}, opts={}, https = 0)</p>
  91. <blockquote>
  92. <p>Connect to a remote server via HTTP (webservice).</p>
  93. <ul class="simple">
  94. <li><cite>remote_host</cite> is the the address of the remote server</li>
  95. <li><cite>path</cite> is the path of the Framework (excluding index.cgi)</li>
  96. </ul>
  97. <dl class="method">
  98. <dt id="webservice.http_get_response">
  99. <tt class="descclassname">webservice.</tt><tt class="descname">http_get_response</tt><big>(</big><em>method</em>, <em>args</em><big>)</big><a class="headerlink" href="#webservice.http_get_response" title="Permalink to this definition">¶</a></dt>
  100. <dd>Run a method on the remote server, with the given arguments</dd></dl>
  101. <dl class="method">
  102. <dt id="webservice.runserverobj">
  103. <tt class="descclassname">webservice.</tt><tt class="descname">runserverobj</tt><big>(</big><em>doctype</em>, <em>docname</em>, <em>method</em>, <em>arg=''</em><big>)</big><a class="headerlink" href="#webservice.runserverobj" title="Permalink to this definition">¶</a></dt>
  104. <dd>Returns the response of a remote method called on a system object specified by <cite>doctype</cite> and <cite>docname</cite></dd></dl>
  105. </blockquote>
  106. </div>
  107. <div class="section" id="example">
  108. <h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2>
  109. <p>Connect to a remote server a run a method <cite>update_login</cite> on <cite>Login Control</cite> on a remote server:</p>
  110. <div class="highlight-python"><div class="highlight"><pre><span class="c"># connect to a remote server</span>
  111. <span class="n">remote</span> <span class="o">=</span> <span class="n">FrameworkServer</span><span class="p">(</span><span class="s">&#39;s2.iwebnote.com&#39;</span><span class="p">,</span> <span class="s">&#39;/v170&#39;</span><span class="p">,</span> <span class="s">&#39;testuser&#39;</span><span class="p">,</span> <span class="s">&#39;testpwd&#39;</span><span class="p">,</span> <span class="s">&#39;testaccount&#39;</span><span class="p">)</span>
  112. <span class="c"># update the login on a remote server</span>
  113. <span class="n">response</span> <span class="o">=</span> <span class="n">remote</span><span class="o">.</span><span class="n">runserverobj</span><span class="p">(</span><span class="s">&#39;Login Control&#39;</span><span class="p">,</span> <span class="s">&#39;Login Control&#39;</span><span class="p">,</span> <span class="s">&#39;update_login&#39;</span><span class="p">,</span> <span class="n">session</span><span class="p">[</span><span class="s">&#39;user&#39;</span><span class="p">])</span>
  114. </pre></div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="clearer"></div>
  122. </div>
  123. <div class="related">
  124. <h3>Navigation</h3>
  125. <ul>
  126. <li class="right" style="margin-right: 10px">
  127. <a href="genindex.html" title="General Index"
  128. >index</a></li>
  129. <li class="right" >
  130. <a href="modindex.html" title="Global Module Index"
  131. >modules</a> |</li>
  132. <li class="right" >
  133. <a href="server_side_internals.html" title="Server Side Internals"
  134. >next</a> |</li>
  135. <li class="right" >
  136. <a href="profile.html" title="profile — Profile"
  137. >previous</a> |</li>
  138. <li><a href="index.html">Documentation</a> &raquo;</li>
  139. <li><a href="server_side_api.html" >3. Server Side API</a> &raquo;</li>
  140. </ul>
  141. </div>
  142. <div class="footer">
  143. &copy; Copyright 2010, Rushabh Mehta.
  144. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
  145. </div>
  146. </body>
  147. </html>