User Tools

Site Tools


Sidebar

vortex:tools:vortexsoapclient

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:

  $myClient = new VortexSoapClient( "[AddressToVortex or wsdl]", "[webservicename]" );
  $rVal = $myClient->myMethod( "MyArgument" );

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.

  public function myMethod() {
    $arg = $this->xml->getElementsByTagName( "function" )->item(0)->nodeValue;
    return "You passed " . $arg;
  }

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