Skip to content

Thomas-Matheus/easy-soapclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy SoapClient

Build Status Scrutinizer Code Quality Code Coverage Codacy Badge Latest Stable Version License
SensioLabsInsight


This is a simple library for consuming webservices soap.

Install

  composer require easy-soapclient/easy-soapclient

Usage

Simple usage

  use EasySoapClient\Client;
  use EasySoapClient\Configuration;
  
  $url = 'http://my-webservice.com/webservice.php?WSDL';
  
  $config = new Configuration($url);
  $result = (new Client($config))->getClient();

  print_r($result->webServiceMethodBar('foo'));
  print_r($result->webServiceMethodFoo('bar', 'foo'));

Usage with Proxy

  use EasySoapClient\Client;
  use EasySoapClient\Configuration;
  use EasySoapClient\ProxyOptions;
  
  $url = 'http://my-webservice.com/webservice.php?WSDL';
  $proxy = new ProxyOptions('your-proxy-host', 3120, 'user', 'password');
  
  $config = new Configuration($url, $proxy);
  $result = (new Client($config))->getClient();

  print_r($result->webServiceMethodFoo('foo'));
  print_r($result->webServiceMethodBar('bar', 'foo'));

Usage with Auth

  use EasySoapClient\Client;
  use EasySoapClient\Configuration;
  use EasySoapClient\AuthOptions;
  
  $url = 'http://my-webservice.com/webservice.php?WSDL';
  $auth = new AuthOptions('user', 'password');
  
  $config = new Configuration($url, null, $auth);
  $result = (new Client($config))->getClient();

  print_r($result->webServiceMethodFoo('foo'));
  print_r($result->webServiceMethodBar('bar', 'foo'));

License

The MIT License (MIT). Please see License File for more information.