User Tools

Site Tools


vortex:tools:vortexsoapclient

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

vortex:tools:vortexsoapclient [2019/06/28 07:25] (current)
hubbe created
Line 1: Line 1:
 +===== VortexSOAPClient Class =====
  
 +=== Introduction ===
 +The VortexSOAPClient Class is an easy way to communicate and integrate with the Vortex from your projects. Simply include the //​vortexsoapclient.php//​ and create an instance of the class.
 +
 +=== Usage ===
 +The class is used by either linking to the PHP-file remotely or copying the file to your project file tree. Simply include the class to your project
 +  require_once "​[path_to_file]/​vortexsoapclient.php"​
 +
 +If you have changed the configuration parameters in your config.xml for the webservice for the function and name attributes you need to change the constants in the class accordingly:​
 +  <​stdhandler enableget="​true"​ enableset="​false"​ function="​function"​ name="​name"​ />
 +gives
 +  const NAME_FOR_FUNCTION = '​function';​
 +  const NAME_FOR_NAME = '​name';​
 +  ​
 +Now it is simply a matter of creating an instance of the VortexSoapClient and call your webservice methods through it:
 +<code php>
 +  $myClient = new VortexSoapClient( "​[AddressToVortex or wsdl]",​ "​[webservicename]"​ );
 +  $rVal = $myClient->​myMethod( "​MyArgument"​ );
 +</​code>​
 +  ​
 +This will call the method //​myMethod//​ in the Vortex WebService handler class as defined in the config.xml for the WebService, with the argument "​MyArgument"​ passed in the XML. To handle this at the server side, the function would look something like.
 +<code php>
 +  public function myMethod() {
 +    $arg = $this->​xml->​getElementsByTagName( "​function"​ )->​item(0)->​nodeValue;​
 +    return "You passed " . $arg;
 +  }
 +</​code>​
 +
 +The class can be constructed with either a URI to the WSDL file for the WebService, or with the URL to the Vortex server and the name of the WebService to use.
vortex/tools/vortexsoapclient.txt ยท Last modified: 2019/06/28 07:25 by hubbe