Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Created November 19, 2020 15:01
Show Gist options
  • Save lighth7015/ccf844ccb668266ba350c359392ad5e0 to your computer and use it in GitHub Desktop.
Save lighth7015/ccf844ccb668266ba350c359392ad5e0 to your computer and use it in GitHub Desktop.
client.php
<?php
//require_once 'vendor/autoload.php';
class RxCredentials {
/**
* Test members
*
* @var string Hello
* @soap
*/
public string $username;
/**
* Test members
*
* @var string Array of WSDLone objects
* @soap
*/
public string $password;
}
class RxResponse {
/**
* @var string
* @soap
*/
public string $Result;
/**
* @var bool
* @soap
*/
public string $Response;
/**
* @var array string
* @soap
*/
public array $Messages;
}
/**
* RxLocation Class
*
* @author Robert Butler <[email protected]>
* @copyright 2020 Health Plan Partners LLC
*/
class RxLocation {
/**
* @var string
* @soap
*/
public string $address = "";
/**
* @var string
* @soap
*/
public string $city = "";
/**
* @var string
* @soap
*/
public string $state = "";
/**
* @var string
* @soap
*/
public string $zipCode = "";
}
/**
* RxContact Class
*
* @author Robert Butler <[email protected]>
* @copyright 2020 Health Plan Partners LLC
*/
class RxContact {
/**
* @var string
* @soap
*/
public string $phoneNumber = "";
/**
* @var string
* @soap
*/
public string $emailAddress = "";
}
class RxRequest extends SoapClient {
private static $options = array(
'exceptions' => true,
'trace' => true,
'location' => 'http://telemed24rx.com/api/v1/member',
'uri' => 'http://telemed24rx.com'
);
private function security(): SoapHeader {
$credentials = new RxCredentials;
$credentials->username = 'Foo';
$credentials->password = 'Bar';
return new SoapHeader('http://telemed24rx.com', 'RxCredentials', $credentials, true );
}
private function headers(): array {
return array(
$this->security()
);
}
public function __construct(string $filename = null) {
parent::__construct(null, static::$options );
$this->__setSoapHeaders($this->headers());
}
}
class RxIdentity {
public $first = "";
public $middle = "";
public $last = "";
}
class RxPrimary {
public $identity;
public $birthday = '';
public $location;
public $contact;
public function __construct() {
$this->identity = new RxIdentity;
$this->location = new RxLocation;
$this->contact = new RxContact;
}
}
$request = new RxRequest;
var_dump(array(
$request->Register(new RxPrimary),
$request));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment