Rajout du code core qui n'était pas gitté
This commit is contained in:
10
core/vendor/wsdltophp/packagebase/.docker/Dockerfile
vendored
Normal file
10
core/vendor/wsdltophp/packagebase/.docker/Dockerfile
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM php:7.2-apache
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y libxml2-dev git zip zlib1g \
|
||||
&& docker-php-ext-install soap
|
||||
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
COPY . /var/www/html
|
||||
|
||||
WORKDIR /var/www/html
|
||||
12
core/vendor/wsdltophp/packagebase/.editorconfig
vendored
Executable file
12
core/vendor/wsdltophp/packagebase/.editorconfig
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
# For more information about the properties used in
|
||||
# this file, please see the EditorConfig documentation:
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
|
||||
[*.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
4
core/vendor/wsdltophp/packagebase/.gitignore
vendored
Normal file
4
core/vendor/wsdltophp/packagebase/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
vendor/
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
|
||||
21
core/vendor/wsdltophp/packagebase/.php_cs
vendored
Executable file
21
core/vendor/wsdltophp/packagebase/.php_cs
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->exclude('vendor')
|
||||
->exclude('tests')
|
||||
->in(__DIR__);
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setUsingCache(false)
|
||||
->setRules(array(
|
||||
'@PSR2' => true,
|
||||
'array_syntax' => [
|
||||
'syntax' => 'short',
|
||||
],
|
||||
'binary_operator_spaces' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'cast_spaces' => true,
|
||||
'trailing_comma_in_multiline_array' => true
|
||||
))
|
||||
->setFinder($finder);
|
||||
23
core/vendor/wsdltophp/packagebase/.travis.yml
vendored
Normal file
23
core/vendor/wsdltophp/packagebase/.travis.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
language: php
|
||||
|
||||
sudo: false
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: 5.4
|
||||
- php: 5.5
|
||||
- php: 5.6
|
||||
- php: 7.0
|
||||
- php: 7.1
|
||||
- php: 7.2
|
||||
|
||||
install:
|
||||
- composer install
|
||||
|
||||
script:
|
||||
- ./vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover
|
||||
|
||||
after_script:
|
||||
- wget https://scrutinizer-ci.com/ocular.phar
|
||||
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
|
||||
|
||||
69
core/vendor/wsdltophp/packagebase/CHANGELOG.md
vendored
Normal file
69
core/vendor/wsdltophp/packagebase/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 1.0.14
|
||||
- Issue #25 - Enhancement: Improve output from running php-cs-fixer
|
||||
- Issue #26 - Enhancement: Keep packages sorted in composer.json
|
||||
- Issue #28 - Add the URI as an option in the soapClient parameters
|
||||
|
||||
## 1.0.13
|
||||
- Issue #22 / Pull request #23 - Add support to invoke getLastRequest without throwing an InvalidArgumentException if the request is not executed
|
||||
|
||||
## 1.0.12
|
||||
- Issue #19 - WSDL_CACHE_WSDL does not work!
|
||||
- Code reviewed as it was not complete, default options were not taken into account properly too, it's working right from now on!
|
||||
|
||||
## 1.0.11
|
||||
- Issue #19 - WSDL_CACHE_WSDL does not work!
|
||||
- Merged pull request #20 - Fix WSDL_CACHE_WSDL not working
|
||||
|
||||
## 1.0.10
|
||||
- Issue #10 - Improve AbstractStructArrayBase class
|
||||
- Issue #13 - Feature request: AbstractStructBase implement JsonSerializable
|
||||
- Add Code of Conduct and Contributing files
|
||||
|
||||
## 1.0.9
|
||||
- Improve code, remove @ usage in generic __set_State method, add SensioLabs Insight badge
|
||||
|
||||
## 1.0.8
|
||||
- Issue #7 - Missing SoapClient location option
|
||||
|
||||
## 1.0.7
|
||||
- Issue #3 - More than one SoapClient in Project
|
||||
|
||||
## 1.0.6
|
||||
- Pull request #4: Rename $optioName to $optionName
|
||||
|
||||
## 1.0.5
|
||||
- Update readme
|
||||
|
||||
## 1.0.4
|
||||
- Issue #2 - Var name change request from $methoName to $methodName
|
||||
|
||||
## 1.0.3
|
||||
- Add utility methods **getStreamContext()** and **getStreamContextOptions()** to AbstractSoapClientbase class
|
||||
|
||||
## 1.0.2
|
||||
- Remove AbstractStructArrayBase::getAttributeName() method due to fatal error on PHP <= 5.3
|
||||
|
||||
## 1.0.1
|
||||
- Interfaces' methods has been well declared as public
|
||||
- Minor readme typo updates
|
||||
|
||||
## 1.0.0
|
||||
- First major release, code coverage improved to reach 100% from the 1.0.0RC02 release.
|
||||
|
||||
## 1.0.0RC02
|
||||
- Major: update source code structure, put all classes under ```src``` folder, rename Tests to tests, update composer and phpunit accordingly
|
||||
|
||||
## 1.0.0RC01
|
||||
- Update Readme
|
||||
- Define interfaces that must be used as interfaces in order to be able to define a usable top class for any generated ServiceType/StructType/ArrayType class by the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator)
|
||||
|
||||
## 0.0.3
|
||||
- Update dependency badge
|
||||
|
||||
## 0.0.2
|
||||
- use top level namespace for SoapHeader class
|
||||
|
||||
## 0.0.1
|
||||
- Initial version
|
||||
46
core/vendor/wsdltophp/packagebase/CODE_OF_CONDUCT.md
vendored
Normal file
46
core/vendor/wsdltophp/packagebase/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@wsdltophp.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
28
core/vendor/wsdltophp/packagebase/CONTRIBUTING.md
vendored
Normal file
28
core/vendor/wsdltophp/packagebase/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Contributing
|
||||
|
||||
Contributions are **welcome** and will be fully **credited**.
|
||||
|
||||
We accept contributions via pull requests on [Github].
|
||||
Please make all pull requests to the `develop` branch, not the `master` branch.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- **Create an issue** - Explain as detailed as possible the issue you encountered so we can understand the context of your pull request
|
||||
- **[Symfony Coding Standard]** - The easiest way to apply the conventions is to run `composer lint`
|
||||
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
|
||||
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
|
||||
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
|
||||
- **Create feature branches** - Don't ask us to pull from your master branch.
|
||||
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
|
||||
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
|
||||
|
||||
## Running Tests
|
||||
|
||||
``` bash
|
||||
$ composer test
|
||||
```
|
||||
|
||||
**Happy coding**!
|
||||
|
||||
[Github]: https://github.com/wsdltophp/packagebase
|
||||
[Symfony Coding Standard]: http://symfony.com/doc/current/contributing/code/standards.html
|
||||
19
core/vendor/wsdltophp/packagebase/LICENSE
vendored
Normal file
19
core/vendor/wsdltophp/packagebase/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2012-2015 Mikaël DELSOL
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
292
core/vendor/wsdltophp/packagebase/README.md
vendored
Normal file
292
core/vendor/wsdltophp/packagebase/README.md
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
# Package Base
|
||||
|
||||
> Classes that are used by the classes generated by the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator) project to ease the SoapClient UX.
|
||||
|
||||
[](https://packagist.org/packages/wsdltophp/packagebase)
|
||||
[](https://packagist.org/packages/wsdltophp/packagebase)
|
||||
[](https://travis-ci.org/WsdlToPhp/PackageBase)
|
||||
[](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/)
|
||||
[](https://scrutinizer-ci.com/g/WsdlToPhp/PackageBase/)
|
||||
[](https://styleci.io/repos/38760239)
|
||||
[](https://insight.sensiolabs.com/projects/bfbc0c8f-5793-489b-8151-36ea149ec98d)
|
||||
|
||||
The goal is to provide generic and useful classes that are on top of the classes generated by the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator) project.
|
||||
|
||||
For example, it allows to easily loop through the array elements of a SOAP result object property, it allows to easily set HTTP and SOAP headers for a SOAP request and it allows to easily populate an object from its array state representation.
|
||||
|
||||
## Main features
|
||||
- [Interfaces](#the-interfaces)
|
||||
- [StructInterface](#structinterface)
|
||||
- [StructArrayInterface](#structarrayinterface)
|
||||
- [SoapClientInterface](#soapclientinterface)
|
||||
- [Abstract classes](#the-abstract-classes)
|
||||
- [AbstractStructBase](#abstractstructbase)
|
||||
- [AbstractStructArrayBase](#abstractstructarraybase)
|
||||
- [AbstractSoapClientBase](#abstractsoapclientbase)
|
||||
|
||||
## The interfaces
|
||||
The defined interfaces must be used in order to be able to match the requirements for the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator) generated classes.
|
||||
|
||||
### StructInterface
|
||||
#### Description
|
||||
This interface must be used to define a new StructType class.
|
||||
|
||||
#### What has to be implemented?
|
||||
There is at least/most one method that must be implemented so it's pretty fast to implement it even if you don't see the goal of it:
|
||||
- **__set_state**: [__set_state](http://php.net/manual/en/language.oop5.magic.php#object.set-state) is useful when you want want to load an object that you stored as a string using [var_export](http://php.net/manual/en/function.var-export.php).
|
||||
|
||||
**If you do not want to implement this method, you can too create your own class that inherits from our [AbstractStructBase](#abstractstructbase) class.**
|
||||
|
||||
### StructArrayInterface
|
||||
#### Description
|
||||
This interface must be used to define a new ArrayType class. The goal is to provide utility methods around Array Structs defined by the Wsdl in order to ease the handling of its content. Therefore, this interface inherits from our [StructInterface](#structinterface) interface plus the native [ArrayAccess](http://php.net/manual/en/class.arrayaccess.php), [Iterator](http://php.net/manual/en/class.iterator.php) and [Countable](http://php.net/manual/en/class.countable.php) PHP interfaces
|
||||
|
||||
#### What has to be implemented?
|
||||
The only method that must be implemented would be **getAttributeName** but be aware that it is implemented in every generated ArrayType class so no need to define it. It's just a reminder of what is available in ArrayType classes.
|
||||
|
||||
So, basically, you MUST at least override the methods declared by the PHP interfaces from which this interface inherits
|
||||
|
||||
**If you do not want to implement all the methods, you can too create your own class that inherits from our [AbstractStructArrayBase](#abstractstructarraybase) class.**
|
||||
|
||||
### SoapClientInterface
|
||||
#### Description
|
||||
This interface must be used to define a new [SoapClient](http://php.net/manual/en/class.soapclient.php) base class for any ```ServiceType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator).
|
||||
|
||||
#### Options
|
||||
Here are the constants/options defined by this interface and their utility:
|
||||
- **DEFAULT_SOAP_CLIENT_CLASS = '\SoapClient'**: this is the default [SoapClient](http://php.net/manual/en/class.soapclient.php) class that is used to send the request. Feel free to override it if you want to use another [SoapClient](http://php.net/manual/en/class.soapclient.php) class
|
||||
- **OPTION_PREFIX**: this is the prefix used for any constant's option name
|
||||
- **WSDL_URL**: option index used to pass the WSDL url
|
||||
- **WSDL_URI**: option index used to pass the target namespace of the SOAP service (required for non-WSDL-mode with with the `location`)
|
||||
- **WSDL_USE**: option index used to pass non-WSDL-mode option use
|
||||
- **WSDL_STYLE**: option index used to pass non-WSDL-mode option style
|
||||
- **WSDL_CLASSMAP**: the classmap's array
|
||||
- **WSDL_LOGIN**: the basic authentication's login
|
||||
- **WSDL_PASSWORD**: the basic authentication's password
|
||||
- **WSDL_TRACE**: tracing of request so faults can be backtraced. This defaults to ```true```
|
||||
- **WSDL_EXCEPTIONS**: boolean value defining whether soap errors throw exceptions of type SoapFault
|
||||
- **WSDL_CACHE_WSDL**: option is one of ```WSDL_CACHE_NONE```, ```WSDL_CACHE_DISK```, ```WSDL_CACHE_MEMORY``` or ```WSDL_CACHE_BOTH```
|
||||
- **WSDL_STREAM_CONTEXT**: a [resource](http://php.net/manual/en/language.types.resource.php) for [context](http://php.net/manual/en/context.php)
|
||||
- **WSDL_SOAP_VERSION**: one of either ```SOAP_1_1``` or ```SOAP_1_2``` to select SOAP 1.1 or 1.2, respectively. If omitted, SOAP 1.1 is used
|
||||
- **WSDL_COMPRESSION**: allows to use compression of HTTP SOAP requests and responses
|
||||
- **WSDL_ENCODING**: internal character encoding. This option does not change the encoding of SOAP requests (it is always utf-8), but converts strings into it
|
||||
- **WSDL_CONNECTION_TIMEOUT**: defines a timeout in seconds for the connection to the SOAP service. This option does not define a timeout for services with slow responses. To limit the time to wait for calls to finish the [default_socket_timeout](http://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout) setting is available
|
||||
- **WSDL_TYPEMAP**: array of type mappings. Type mapping is an array with keys type_name, type_ns (namespace URI), from_xml (callback accepting one string parameter) and to_xml (callback accepting one object parameter)
|
||||
- **WSDL_USER_AGENT**: specifies string to use in User-Agent header
|
||||
- **WSDL_FEATURES**: a bitmask of ```SOAP_SINGLE_ELEMENT_ARRAYS```, ```SOAP_USE_XSI_ARRAY_TYPE```, ```SOAP_WAIT_ONE_WAY_CALLS```
|
||||
- **WSDL_KEEP_ALIVE**: a boolean value defining whether to send the Connection: Keep-Alive header or Connection: close
|
||||
- **WSDL_PROXY_HOST**: your pxoxy hostname
|
||||
- **WSDL_PROXY_PORT**: your proxy port
|
||||
- **WSDL_PROXY_LOGIN**: your proxy login
|
||||
- **WSDL_PROXY_PASSWORD**: your proxy password
|
||||
- **WSDL_LOCAL_CERT**: your local certificate content (as a string)
|
||||
- **WSDL_PASSPHRASE**: your local passphrase content (as a string)
|
||||
- **WSDL_AUTHENTICATION**: authentication method may be either ```SOAP_AUTHENTICATION_BASIC``` (default) or ```SOAP_AUTHENTICATION_DIGEST```
|
||||
- **WSDL_SSL_METHOD**: one of ```SOAP_SSL_METHOD_TLS```, ```SOAP_SSL_METHOD_SSLv2```, ```SOAP_SSL_METHOD_SSLv3``` or ```SOAP_SSL_METHOD_SSLv23```
|
||||
|
||||
#### What has to be implemented?
|
||||
Here are the methods that must be implemented and why:
|
||||
- **__construct(array $wsdlOptions = array(), $resetSoapClient = true)**: the constructor must be able to handl one of the listed constants above
|
||||
- **getSoapClient()**: must return the [SoapClient](http://php.net/manual/en/class.soapclient.php) object that is responsible fo sending the requests.
|
||||
- **setSoapHeader($nameSpace, $name, $data, $mustUnderstand = false, $actor = null)**: look to [AbstractSoapClientBase](#abstractsoapclientbase) part that details this method. Basically, it allows to define [SoapHeader](http://php.net/manual/en/class.soapheader.php)s for the request
|
||||
- **getLastError()**: must return the last error, its format is up to you
|
||||
- **saveLastError($methodName, \SoapFault $soapFault)**: look to [AbstractSoapClientBase](#abstractsoapclientbase) part that details this method. Basically, it must allow to store a catched [Soapfault](http://php.net/manual/en/class.soapfault.php) object when a request has failed
|
||||
- **getResult()**: should return the Soap Web Service response, it's up to you
|
||||
- **setResult($result)**: must accept any parameter type as it should received the Soap Web Service response
|
||||
|
||||
**If you do not want to implement all these methods, you can too create your own class that inherits from our [AbstractSoapClientBase](#abstractsoapclientbase) class.**
|
||||
|
||||
## The abstract classes
|
||||
### AbstractStructBase
|
||||
#### Description
|
||||
This class is the base class for any ```StructType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator). It implements our [StructInterface](#structinterface) interface.
|
||||
It defines four methods:
|
||||
- **__set_state($array)**: Useful when you load the string representation of an object that you stored using ```var_export```. It also allows you to ease the instanciation of an object that contains many properties which would be hard to instanciate using the ```__construct``` method. You can see ```__set_state``` as an hydratation method.
|
||||
- **_set($name, $value)**: As magic method ```__set``` but used by the ```__set_state``` method. Plus, defining ```__set``` method on used class by the classmap option for the [SoapClient](http://php.net/manual/en/class.soapclient.php) breaks the correct hydratation of your received objects.
|
||||
- **_get($name)**: As magic method ```__get```. Used by our [AbstractStructArrayBase](#abstractstructarraybase) class.
|
||||
- **jsonSerialize()**: by implementing the [\JsonSerializable](http://php.net/manual/en/class.jsonserializable.php) interface, it implements this method that allows to pass the object to the [json_encode](http://php.net/manual/en/function.json-encode.php) method so it will return the properties of the current object in an array.
|
||||
|
||||
#### Usage
|
||||
```php
|
||||
$item = \Api\StructType\Item::__set_state(array(
|
||||
'id' => 1,
|
||||
'name' => 'Entity #1',
|
||||
'label' => 'Entity #1',
|
||||
'_href' => 'http://www.entity.com',
|
||||
));
|
||||
// $item is now an \Api\StructType\Item object
|
||||
```
|
||||
|
||||
### AbstractStructArrayBase
|
||||
#### Description
|
||||
This class is the base class for any ```ArrayType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator). It implements our [StructArrayInterface](#structarrayinterface) interface.
|
||||
|
||||
#### Usage
|
||||
As soon as you have an element that is an array of items such as:
|
||||
```php
|
||||
$items = \Api\ArrayType\Items::__set_state(array(
|
||||
'items' => array(
|
||||
\Api\StructType\Item::__set_state(array(
|
||||
'id' => 1,
|
||||
'name' => 'Entity #1',
|
||||
'label' => 'Entity #1',
|
||||
'_href' => 'http://www.entity-1.com',
|
||||
),
|
||||
\Api\StructType\Item::__set_state(array(
|
||||
'id' => 2,
|
||||
'name' => 'Entity #2',
|
||||
'label' => 'Entity #2',
|
||||
'_href' => 'http://www.entity-2.com',
|
||||
),
|
||||
\Api\StructType\Item::__set_state(array(
|
||||
'id' => 3,
|
||||
'name' => 'Entity #3',
|
||||
'label' => 'Entity #3',
|
||||
'_href' => 'http://www.entity-3.com',
|
||||
),
|
||||
)
|
||||
));
|
||||
// 'items' is the unique property of the object
|
||||
// Its name is returned by the getAttributeName method
|
||||
// defined in the generated \Api\ArrayType\Items class
|
||||
```
|
||||
- **You MUST call first** ```initInternArray``` method on your ArrayType object otherwise you'll get nothing working for the implemented methods:
|
||||
```php
|
||||
$items->initInternArray();
|
||||
```
|
||||
- then you can call ```count```, ```length``` methods: gives you the number of items contained by your object
|
||||
- you can iterate through the items:
|
||||
```php
|
||||
foreach ($items as $item) {
|
||||
// $items->current() and $item is an \Api\StructType\Item object
|
||||
// $items->key() is the current index
|
||||
}
|
||||
```
|
||||
- you can get the first item:
|
||||
```php
|
||||
$items->first();
|
||||
```
|
||||
- you can get the last item:
|
||||
```php
|
||||
$items->last();
|
||||
```
|
||||
- you can get any item:
|
||||
```php
|
||||
$items->item($index);
|
||||
```
|
||||
- you can add a new item:
|
||||
```php
|
||||
$items->add(\Api\StructType\Item::__set_state(array(
|
||||
'id' => 4,
|
||||
'name' => 'Entity #4',
|
||||
'label' => 'Entity #4',
|
||||
'_href' => 'http://www.entity-4.com',
|
||||
)));
|
||||
```
|
||||
- you can even reset the items:
|
||||
```php
|
||||
$items->initInternArray(array(
|
||||
\Api\StructType\Item::__set_state(array(
|
||||
'id' => 0,
|
||||
'name' => 'Entity #0',
|
||||
'label' => 'Entity #0',
|
||||
'_href' => 'http://www.entity-0.com',
|
||||
),
|
||||
\Api\StructType\Item::__set_state(array(
|
||||
'id' => 1,
|
||||
'name' => 'Entity #1',
|
||||
'label' => 'Entity #1',
|
||||
'_href' => 'http://www.entity-1.com',
|
||||
),
|
||||
\Api\StructType\Item::__set_state(array(
|
||||
'id' => 2,
|
||||
'name' => 'Entity #2',
|
||||
'label' => 'Entity #2',
|
||||
'_href' => 'http://www.entity-2.com',
|
||||
),
|
||||
));
|
||||
```
|
||||
|
||||
### AbstractSoapClientBase
|
||||
#### Description
|
||||
This class is the base class for any ```ServiceType``` class generated by [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator).
|
||||
Its goal is to provide utility/handful methods by implementing our [SoapClientInterface](#soapclientinterface) interface.
|
||||
It's basically a decorator design pattern as the class has the [SoapClient](http://php.net/manual/en/class.soapclient.php) object as a static property in order to be able to apply methods on it. It is a static property in order to have a singleton between multiple calls (allowing to send cookies automatically between calls). It can be reset by passing true as the second parameter.
|
||||
|
||||
#### Usage
|
||||
Let's say you have this type of generate ```ServiceType``` class:
|
||||
```php
|
||||
namespace Api\ServiceType;
|
||||
use \WsdlToPhp\PackageBase\AbstractSoapClientBase;
|
||||
class ApiUpdate extends AbstractSoapClientBase
|
||||
{
|
||||
public function UpdateBulkOrder(\Api\StructType\ApiUpdateBulkOrder $parameters)
|
||||
{
|
||||
try {
|
||||
$this->setResult(self::getSoapClient()->UpdateBulkOrder($parameters));
|
||||
return $this->getResult();
|
||||
} catch (\SoapFault $soapFault) {
|
||||
$this->saveLastError(__METHOD__, $soapFault);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
You can do:
|
||||
```php
|
||||
use \WsdlToPhp\PackageBase\AbstractSoapClientBase;
|
||||
$options = array(
|
||||
AbstractSoapClientBase::WSDL_URL => '__WSDL_URL__',
|
||||
AbstractSoapClientBase::WSDL_CLASSMAP => \Api\ApiClassMap::classMap(),
|
||||
);
|
||||
// sets the first instance of SoapClient within AbstractSoapClientBase
|
||||
$update = new \Api\ServiceType\ApiUpdate($options);
|
||||
// resets the SoapClient instance
|
||||
$update = new \Api\ServiceType\ApiUpdate($options, true);
|
||||
```
|
||||
Then call any of these base methods:
|
||||
- **getResult**: return the actual response as an object. The object's class should be a generated class
|
||||
- **getLastRequest($asDomDocument = false)**: returns either the XML string version or the ```DOMDocument``` version of the request
|
||||
- **getLastResponse($asDomDocument = false)**: returns either the XML string version or the ```DOMDocument``` version of the response
|
||||
- **getLastRequestHeaders($asArray = false)**: returns either the HTTP request's headers as a string or as an array (each HTTP header is parsed)
|
||||
- **getLastResponseHeaders($asArray = false)**: returns either the HTTP response's headers as a string or as an array
|
||||
- **getLastError**: automatically populated with an error when ```$this->saveLastError(__METHOD__, $soapFault)``` is called
|
||||
- **getLastErrorForMethod($methodName)** : returns the error associated to the called method. It should return a ```SoapFault``` object
|
||||
```php
|
||||
$result = $update->UpdateBulkOrder(new \Api\StructType\ApiUpdateBulkOrder())
|
||||
if ($result !== false) {
|
||||
echo "\nThis is the result as an object:" . print_r($update->getResult(), true);
|
||||
// Actually $result is the same data than $update->getResult()
|
||||
} else {
|
||||
echo "\nThis is the XML request:" . $update->getLastRequest(false);
|
||||
echo "\nThese are the request's headers:" . $update->getLastRequestHeaders(false);
|
||||
echo "\nThis is the XML response:" . $update->getLastResponse(false);
|
||||
echo "\nThese are the response's headers:" . $update->getLastResponseHeaders(false);
|
||||
echo "\nThese are the last errors:" . print_r($update->getLastError(), true);
|
||||
echo "\nThis is the current error:" . print_r($update->getLastErrorForMethod('\Api\ServiceType\ApiUpdate::UpdateBulkOrder'), true);
|
||||
}
|
||||
```
|
||||
You have additional methods such as:
|
||||
- **setSoapHeader($nameSpace, $name, $data, $mustUnderstand = false, $actor = null)**: it provides a way to redefine SoapHeaders
|
||||
```php
|
||||
// A sample of its usage in the generated ServiceType class
|
||||
public function setSoapHeaderCSPCHD(\Api\StructType\ApiCSPCHD $cSPCHD, $nameSpace = 'http://tempuri.org', $mustUnderstand = false, $actor = null)
|
||||
{
|
||||
return $this->setSoapHeader($nameSpace, 'CSPCHD', $cSPCHD, $mustUnderstand, $actor);
|
||||
}
|
||||
```
|
||||
- **setHttpHeader($headerName, $headerValue)**: an easy way to define your proper HTTP headers that must be sent
|
||||
- **setLocation($location)**: Sets the location of the Web service to use
|
||||
- **getStreamContext()**: Returns the created stream context used by the SoapClient class
|
||||
- **getStreamContextOptions()**: Returns the created stream context's options used by the SoapClient class
|
||||
|
||||
## Need improvements for these classes?
|
||||
Feel free to make some pull requests. We'll study them and let you know when it can be integrated.
|
||||
|
||||
## Unit tests
|
||||
You can run the unit tests with the following command:
|
||||
```
|
||||
$ cd /path/to/src/WsdlToPhp/PackageBase/
|
||||
$ composer install
|
||||
$ composer test
|
||||
```
|
||||
62
core/vendor/wsdltophp/packagebase/composer.json
vendored
Normal file
62
core/vendor/wsdltophp/packagebase/composer.json
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "wsdltophp/packagebase",
|
||||
"description": "Contains the base classes to be used by classes generated by wsdltophp/packagegenerator",
|
||||
"type": "library",
|
||||
"keywords" : ["php","models"],
|
||||
"homepage" : "https://github.com/WsdlToPhp/PackageBase",
|
||||
"license" : "MIT",
|
||||
"authors" : [
|
||||
{
|
||||
"name": "Mikaël DELSOL",
|
||||
"email": "contact@wsdltophp.com",
|
||||
"role": "Owner"
|
||||
},
|
||||
{
|
||||
"name": "Luke Rodgers",
|
||||
"email": "lukerodgers90@gmail.com",
|
||||
"role": "Contributor"
|
||||
},
|
||||
{
|
||||
"name": "Arthur Moore",
|
||||
"email": "github@cd-net.net",
|
||||
"role": "Contributor"
|
||||
},
|
||||
{
|
||||
"name": "Necati Yared Ozal",
|
||||
"email": "mail@necatiozal.com",
|
||||
"role": "Contributor"
|
||||
},
|
||||
{
|
||||
"name": "Gemorroj",
|
||||
"email": "wapinet@mail.ru",
|
||||
"role": "Contributor"
|
||||
},
|
||||
{
|
||||
"name": "hordijk",
|
||||
"role": "Contributor"
|
||||
}
|
||||
],
|
||||
"support" : {
|
||||
"email" : "contact@wsdltophp.com"
|
||||
},
|
||||
"require": {
|
||||
"php" : ">=5.4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit",
|
||||
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "~2.0",
|
||||
"phpunit/phpunit": "^4.8 || ^6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"WsdlToPhp\\PackageBase\\": "src",
|
||||
"WsdlToPhp\\PackageBase\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
10
core/vendor/wsdltophp/packagebase/docker-compose.yml
vendored
Normal file
10
core/vendor/wsdltophp/packagebase/docker-compose.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .docker/Dockerfile
|
||||
volumes:
|
||||
- .:/var/www/html:rw
|
||||
container_name: package_base
|
||||
26
core/vendor/wsdltophp/packagebase/phpunit.xml.dist
vendored
Normal file
26
core/vendor/wsdltophp/packagebase/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php">
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
</php>
|
||||
|
||||
<testsuite name="Test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
||||
482
core/vendor/wsdltophp/packagebase/src/AbstractSoapClientBase.php
vendored
Normal file
482
core/vendor/wsdltophp/packagebase/src/AbstractSoapClientBase.php
vendored
Normal file
@@ -0,0 +1,482 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
abstract class AbstractSoapClientBase implements SoapClientInterface
|
||||
{
|
||||
/**
|
||||
* Soapclient called to communicate with the actual SOAP Service
|
||||
* @var \SoapClient
|
||||
*/
|
||||
private static $soapClient;
|
||||
/**
|
||||
* Contains Soap call result
|
||||
* @var mixed
|
||||
*/
|
||||
private $result;
|
||||
/**
|
||||
* Contains last errors
|
||||
* @var array
|
||||
*/
|
||||
private $lastError;
|
||||
/**
|
||||
* Constructor
|
||||
* @uses AbstractSoapClientBase::setLastError()
|
||||
* @uses AbstractSoapClientBase::initSoapClient()
|
||||
* @param array $wsdlOptions
|
||||
* @param bool $resetSoapClient allows to disable the SoapClient redefinition
|
||||
*/
|
||||
public function __construct(array $wsdlOptions = [], $resetSoapClient = true)
|
||||
{
|
||||
$this->setLastError([]);
|
||||
/**
|
||||
* Init soap Client
|
||||
* Set default values
|
||||
*/
|
||||
if ($resetSoapClient) {
|
||||
$this->initSoapClient($wsdlOptions);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Static method getting current SoapClient
|
||||
* @return \SoapClient
|
||||
*/
|
||||
public static function getSoapClient()
|
||||
{
|
||||
return self::$soapClient;
|
||||
}
|
||||
/**
|
||||
* Static method setting current SoapClient
|
||||
* @param \SoapClient $soapClient
|
||||
* @return \SoapClient
|
||||
*/
|
||||
public static function setSoapClient(\SoapClient $soapClient)
|
||||
{
|
||||
return (self::$soapClient = $soapClient);
|
||||
}
|
||||
/**
|
||||
* Method initiating SoapClient
|
||||
* @uses ApiClassMap::classMap()
|
||||
* @uses AbstractSoapClientBase::getDefaultWsdlOptions()
|
||||
* @uses AbstractSoapClientBase::getSoapClientClassName()
|
||||
* @uses AbstractSoapClientBase::setSoapClient()
|
||||
* @uses AbstractSoapClientBase::OPTION_PREFIX
|
||||
* @param array $options WSDL options
|
||||
* @return void
|
||||
*/
|
||||
public function initSoapClient(array $options)
|
||||
{
|
||||
self::$soapClient = null;
|
||||
$wsdlOptions = [];
|
||||
$defaultWsdlOptions = static::getDefaultWsdlOptions();
|
||||
foreach ($defaultWsdlOptions as $optionName => $optionValue) {
|
||||
if (array_key_exists($optionName, $options) && !is_null($options[$optionName])) {
|
||||
$wsdlOptions[str_replace(self::OPTION_PREFIX, '', $optionName)] = $options[$optionName];
|
||||
} elseif (!is_null($optionValue)) {
|
||||
$wsdlOptions[str_replace(self::OPTION_PREFIX, '', $optionName)] = $optionValue;
|
||||
}
|
||||
}
|
||||
if (self::canInstantiateSoapClientWithOptions($wsdlOptions)) {
|
||||
$wsdlUrl = null;
|
||||
if (array_key_exists(str_replace(self::OPTION_PREFIX, '', self::WSDL_URL), $wsdlOptions)) {
|
||||
$wsdlUrl = $wsdlOptions[str_replace(self::OPTION_PREFIX, '', self::WSDL_URL)];
|
||||
unset($wsdlOptions[str_replace(self::OPTION_PREFIX, '', self::WSDL_URL)]);
|
||||
}
|
||||
$soapClientClassName = $this->getSoapClientClassName();
|
||||
static::setSoapClient(new $soapClientClassName($wsdlUrl, $wsdlOptions));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Checks if the provided options are sufficient to instantiate a SoapClient:
|
||||
* - WSDL-mode : only the WSDL is required
|
||||
* - non-WSDL-mode : URI and LOCATION are required, WSDL url can be empty then
|
||||
* @uses AbstractSoapClientBase::OPTION_PREFIX
|
||||
* @param $wsdlOptions
|
||||
* @return bool
|
||||
*/
|
||||
protected static function canInstantiateSoapClientWithOptions($wsdlOptions)
|
||||
{
|
||||
return (
|
||||
array_key_exists(str_replace(self::OPTION_PREFIX, '', self::WSDL_URL), $wsdlOptions) ||
|
||||
(
|
||||
array_key_exists(str_replace(self::OPTION_PREFIX, '', self::WSDL_URI), $wsdlOptions) &&
|
||||
array_key_exists(str_replace(self::OPTION_PREFIX, '', self::WSDL_LOCATION), $wsdlOptions)
|
||||
)
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Returns the SoapClient class name to use to create the instance of the SoapClient.
|
||||
* The SoapClient class is determined based on the package name.
|
||||
* If a class is named as {Api}SoapClient, then this is the class that will be used.
|
||||
* Be sure that this class inherits from the native PHP SoapClient class and this class has been loaded or can be loaded.
|
||||
* The goal is to allow the override of the SoapClient without having to modify this generated class.
|
||||
* Then the overridding SoapClient class can override for example the SoapClient::__doRequest() method if it is needed.
|
||||
* @uses AbstractSoapClientBase::DEFAULT_SOAP_CLIENT_CLASS
|
||||
* @return string
|
||||
*/
|
||||
public function getSoapClientClassName($soapClientClassName = null)
|
||||
{
|
||||
$className = self::DEFAULT_SOAP_CLIENT_CLASS;
|
||||
if (!empty($soapClientClassName) && is_subclass_of($soapClientClassName, '\SoapClient')) {
|
||||
$className = $soapClientClassName;
|
||||
}
|
||||
return $className;
|
||||
}
|
||||
/**
|
||||
* Method returning all default options values
|
||||
* @uses AbstractSoapClientBase::WSDL_AUTHENTICATION
|
||||
* @uses AbstractSoapClientBase::WSDL_CACHE_WSDL
|
||||
* @uses AbstractSoapClientBase::WSDL_CLASSMAP
|
||||
* @uses AbstractSoapClientBase::WSDL_COMPRESSION
|
||||
* @uses AbstractSoapClientBase::WSDL_CONNECTION_TIMEOUT
|
||||
* @uses AbstractSoapClientBase::WSDL_ENCODING
|
||||
* @uses AbstractSoapClientBase::WSDL_EXCEPTIONS
|
||||
* @uses AbstractSoapClientBase::WSDL_FEATURES
|
||||
* @uses AbstractSoapClientBase::WSDL_LOCAL_CERT
|
||||
* @uses AbstractSoapClientBase::WSDL_LOCATION
|
||||
* @uses AbstractSoapClientBase::WSDL_LOGIN
|
||||
* @uses AbstractSoapClientBase::WSDL_PASSPHRASE
|
||||
* @uses AbstractSoapClientBase::WSDL_PASSWORD
|
||||
* @uses AbstractSoapClientBase::WSDL_PROXY_HOST
|
||||
* @uses AbstractSoapClientBase::WSDL_PROXY_LOGIN
|
||||
* @uses AbstractSoapClientBase::WSDL_PROXY_PASSWORD
|
||||
* @uses AbstractSoapClientBase::WSDL_PROXY_PORT
|
||||
* @uses AbstractSoapClientBase::WSDL_SOAP_VERSION
|
||||
* @uses AbstractSoapClientBase::WSDL_SSL_METHOD
|
||||
* @uses AbstractSoapClientBase::WSDL_STREAM_CONTEXT
|
||||
* @uses AbstractSoapClientBase::WSDL_STYLE
|
||||
* @uses AbstractSoapClientBase::WSDL_TRACE
|
||||
* @uses AbstractSoapClientBase::WSDL_TYPEMAP
|
||||
* @uses AbstractSoapClientBase::WSDL_URL
|
||||
* @uses AbstractSoapClientBase::WSDL_URI
|
||||
* @uses AbstractSoapClientBase::WSDL_USE
|
||||
* @uses AbstractSoapClientBase::WSDL_USER_AGENT
|
||||
* @uses WSDL_CACHE_NONE
|
||||
* @uses SOAP_SINGLE_ELEMENT_ARRAYS
|
||||
* @uses SOAP_USE_XSI_ARRAY_TYPE
|
||||
* @return array
|
||||
*/
|
||||
public static function getDefaultWsdlOptions()
|
||||
{
|
||||
return [
|
||||
self::WSDL_AUTHENTICATION => null,
|
||||
self::WSDL_CACHE_WSDL => WSDL_CACHE_NONE,
|
||||
self::WSDL_CLASSMAP => null,
|
||||
self::WSDL_COMPRESSION => null,
|
||||
self::WSDL_CONNECTION_TIMEOUT => null,
|
||||
self::WSDL_ENCODING => null,
|
||||
self::WSDL_EXCEPTIONS => true,
|
||||
self::WSDL_FEATURES => SOAP_SINGLE_ELEMENT_ARRAYS | SOAP_USE_XSI_ARRAY_TYPE,
|
||||
self::WSDL_LOCAL_CERT => null,
|
||||
self::WSDL_LOCATION => null,
|
||||
self::WSDL_LOGIN => null,
|
||||
self::WSDL_PASSPHRASE => null,
|
||||
self::WSDL_PASSWORD => null,
|
||||
self::WSDL_PROXY_HOST => null,
|
||||
self::WSDL_PROXY_LOGIN => null,
|
||||
self::WSDL_PROXY_PASSWORD => null,
|
||||
self::WSDL_PROXY_PORT => null,
|
||||
self::WSDL_SOAP_VERSION => null,
|
||||
self::WSDL_SSL_METHOD => null,
|
||||
self::WSDL_STREAM_CONTEXT => null,
|
||||
self::WSDL_STYLE => null,
|
||||
self::WSDL_TRACE => true,
|
||||
self::WSDL_TYPEMAP => null,
|
||||
self::WSDL_URL => null,
|
||||
self::WSDL_URI => null,
|
||||
self::WSDL_USE => null,
|
||||
self::WSDL_USER_AGENT => null,
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Allows to set the SoapClient location to call
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @uses SoapClient::__setLocation()
|
||||
* @param string $location
|
||||
* @return AbstractSoapClientBase
|
||||
*/
|
||||
public function setLocation($location)
|
||||
{
|
||||
if (static::getSoapClient() instanceof \SoapClient) {
|
||||
static::getSoapClient()->__setLocation($location);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns the last request content as a DOMDocument or as a formated XML String
|
||||
* @see SoapClient::__getLastRequest()
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @uses AbstractSoapClientBase::getFormatedXml()
|
||||
* @uses SoapClient::__getLastRequest()
|
||||
* @param bool $asDomDocument
|
||||
* @return \DOMDocument|string|null
|
||||
*/
|
||||
public function getLastRequest($asDomDocument = false)
|
||||
{
|
||||
return $this->getLastXml('__getLastRequest', $asDomDocument);
|
||||
}
|
||||
/**
|
||||
* Returns the last response content as a DOMDocument or as a formated XML String
|
||||
* @see SoapClient::__getLastResponse()
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @uses AbstractSoapClientBase::getFormatedXml()
|
||||
* @uses SoapClient::__getLastResponse()
|
||||
* @param bool $asDomDocument
|
||||
* @return \DOMDocument|string|null
|
||||
*/
|
||||
public function getLastResponse($asDomDocument = false)
|
||||
{
|
||||
return $this->getLastXml('__getLastResponse', $asDomDocument);
|
||||
}
|
||||
/**
|
||||
* @param string $method
|
||||
* @param bool $asDomDocument
|
||||
* @return \DOMDocument|string|null
|
||||
*/
|
||||
protected function getLastXml($method, $asDomDocument = false)
|
||||
{
|
||||
$xml = null;
|
||||
if (static::getSoapClient() instanceof \SoapClient) {
|
||||
$xml = static::getFormatedXml(static::getSoapClient()->$method(), $asDomDocument);
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
/**
|
||||
* Returns the last request headers used by the SoapClient object as the original value or an array
|
||||
* @see SoapClient::__getLastRequestHeaders()
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @uses AbstractSoapClientBase::convertStringHeadersToArray()
|
||||
* @uses SoapClient::__getLastRequestHeaders()
|
||||
* @param bool $asArray allows to get the headers in an associative array
|
||||
* @return null|string|array
|
||||
*/
|
||||
public function getLastRequestHeaders($asArray = false)
|
||||
{
|
||||
return $this->getLastHeaders('__getLastRequestHeaders', $asArray);
|
||||
}
|
||||
/**
|
||||
* Returns the last response headers used by the SoapClient object as the original value or an array
|
||||
* @see SoapClient::__getLastResponseHeaders()
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @uses AbstractSoapClientBase::convertStringHeadersToArray()
|
||||
* @uses SoapClient::__getLastRequestHeaders()
|
||||
* @param bool $asArray allows to get the headers in an associative array
|
||||
* @return null|string|array
|
||||
*/
|
||||
public function getLastResponseHeaders($asArray = false)
|
||||
{
|
||||
return $this->getLastHeaders('__getLastResponseHeaders', $asArray);
|
||||
}
|
||||
/**
|
||||
* @param string $method
|
||||
* @param bool $asArray allows to get the headers in an associative array
|
||||
* @return string[]|null
|
||||
*/
|
||||
protected function getLastHeaders($method, $asArray)
|
||||
{
|
||||
$headers = static::getSoapClient() instanceof \SoapClient ? static::getSoapClient()->$method() : null;
|
||||
if (is_string($headers) && $asArray) {
|
||||
return static::convertStringHeadersToArray($headers);
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
/**
|
||||
* Returns a XML string content as a DOMDocument or as a formated XML string
|
||||
* @uses \DOMDocument::loadXML()
|
||||
* @uses \DOMDocument::saveXML()
|
||||
* @param string $string
|
||||
* @param bool $asDomDocument
|
||||
* @return \DOMDocument|string|null
|
||||
*/
|
||||
public static function getFormatedXml($string, $asDomDocument = false)
|
||||
{
|
||||
return Utils::getFormatedXml($string, $asDomDocument);
|
||||
}
|
||||
/**
|
||||
* Returns an associative array between the headers name and their respective values
|
||||
* @param string $headers
|
||||
* @return string[]
|
||||
*/
|
||||
public static function convertStringHeadersToArray($headers)
|
||||
{
|
||||
$lines = explode("\r\n", $headers);
|
||||
$headers = [];
|
||||
foreach ($lines as $line) {
|
||||
if (strpos($line, ':')) {
|
||||
$headerParts = explode(':', $line);
|
||||
$headers[$headerParts[0]] = trim(implode(':', array_slice($headerParts, 1)));
|
||||
}
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
/**
|
||||
* Sets a SoapHeader to send
|
||||
* For more information, please read the online documentation on {@link http://www.php.net/manual/en/class.soapheader.php}
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @uses SoapClient::__setSoapheaders()
|
||||
* @param string $nameSpace SoapHeader namespace
|
||||
* @param string $name SoapHeader name
|
||||
* @param mixed $data SoapHeader data
|
||||
* @param bool $mustUnderstand
|
||||
* @param string $actor
|
||||
* @return AbstractSoapClientBase
|
||||
*/
|
||||
public function setSoapHeader($nameSpace, $name, $data, $mustUnderstand = false, $actor = null)
|
||||
{
|
||||
if (static::getSoapClient()) {
|
||||
$defaultHeaders = (isset(static::getSoapClient()->__default_headers) && is_array(static::getSoapClient()->__default_headers)) ? static::getSoapClient()->__default_headers : [];
|
||||
foreach ($defaultHeaders as $index => $soapHeader) {
|
||||
if ($soapHeader->name === $name) {
|
||||
unset($defaultHeaders[$index]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
static::getSoapClient()->__setSoapheaders(null);
|
||||
if (!empty($actor)) {
|
||||
array_push($defaultHeaders, new \SoapHeader($nameSpace, $name, $data, $mustUnderstand, $actor));
|
||||
} else {
|
||||
array_push($defaultHeaders, new \SoapHeader($nameSpace, $name, $data, $mustUnderstand));
|
||||
}
|
||||
static::getSoapClient()->__setSoapheaders($defaultHeaders);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Sets the SoapClient Stream context HTTP Header name according to its value
|
||||
* If a context already exists, it tries to modify it
|
||||
* It the context does not exist, it then creates it with the header name and its value
|
||||
* @uses AbstractSoapClientBase::getSoapClient()
|
||||
* @param string $headerName
|
||||
* @param mixed $headerValue
|
||||
* @return bool
|
||||
*/
|
||||
public function setHttpHeader($headerName, $headerValue)
|
||||
{
|
||||
$state = false;
|
||||
if (static::getSoapClient() && !empty($headerName)) {
|
||||
$streamContext = $this->getStreamContext();
|
||||
if ($streamContext === null) {
|
||||
$options = [];
|
||||
$options['http'] = [];
|
||||
$options['http']['header'] = '';
|
||||
} else {
|
||||
$options = stream_context_get_options($streamContext);
|
||||
if (!array_key_exists('http', $options) || !is_array($options['http'])) {
|
||||
$options['http'] = [];
|
||||
$options['http']['header'] = '';
|
||||
} elseif (!array_key_exists('header', $options['http'])) {
|
||||
$options['http']['header'] = '';
|
||||
}
|
||||
}
|
||||
if (count($options) && array_key_exists('http', $options) && is_array($options['http']) && array_key_exists('header', $options['http']) && is_string($options['http']['header'])) {
|
||||
$lines = explode("\r\n", $options['http']['header']);
|
||||
/**
|
||||
* Ensure there is only one header entry for this header name
|
||||
*/
|
||||
$newLines = [];
|
||||
foreach ($lines as $line) {
|
||||
if (!empty($line) && strpos($line, $headerName) === false) {
|
||||
array_push($newLines, $line);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Add new header entry
|
||||
*/
|
||||
array_push($newLines, "$headerName: $headerValue");
|
||||
/**
|
||||
* Set the context http header option
|
||||
*/
|
||||
$options['http']['header'] = implode("\r\n", $newLines);
|
||||
/**
|
||||
* Create context if it does not exist
|
||||
*/
|
||||
if ($streamContext === null) {
|
||||
$state = (static::getSoapClient()->_stream_context = stream_context_create($options)) ? true : false;
|
||||
} else {
|
||||
/**
|
||||
* Set the new context http header option
|
||||
*/
|
||||
$state = stream_context_set_option(static::getSoapClient()->_stream_context, 'http', 'header', $options['http']['header']);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $state;
|
||||
}
|
||||
/**
|
||||
* Returns current \SoapClient::_stream_context resource or null
|
||||
* @return resource|null
|
||||
*/
|
||||
public function getStreamContext()
|
||||
{
|
||||
return (static::getSoapClient() && isset(static::getSoapClient()->_stream_context) && is_resource(static::getSoapClient()->_stream_context)) ? static::getSoapClient()->_stream_context : null;
|
||||
}
|
||||
/**
|
||||
* Returns current \SoapClient::_stream_context resource options or empty array
|
||||
* @return array
|
||||
*/
|
||||
public function getStreamContextOptions()
|
||||
{
|
||||
$options = [];
|
||||
$context = $this->getStreamContext();
|
||||
if ($context !== null) {
|
||||
$options = stream_context_get_options($context);
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
/**
|
||||
* Method returning last errors occured during the calls
|
||||
* @return array
|
||||
*/
|
||||
public function getLastError()
|
||||
{
|
||||
return $this->lastError;
|
||||
}
|
||||
/**
|
||||
* Method setting last errors occured during the calls
|
||||
* @param array $lastError
|
||||
* @return AbstractSoapClientBase
|
||||
*/
|
||||
private function setLastError($lastError)
|
||||
{
|
||||
$this->lastError = $lastError;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method saving the last error returned by the SoapClient
|
||||
* @param string $methodName the method called when the error occurred
|
||||
* @param \SoapFault $soapFault l'objet de l'erreur
|
||||
* @return AbstractSoapClientBase
|
||||
*/
|
||||
public function saveLastError($methodName, \SoapFault $soapFault)
|
||||
{
|
||||
$this->lastError[$methodName] = $soapFault;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method getting the last error for a certain method
|
||||
* @param string $methodName method name to get error from
|
||||
* @return \SoapFault|null
|
||||
*/
|
||||
public function getLastErrorForMethod($methodName)
|
||||
{
|
||||
return array_key_exists($methodName, $this->lastError) ? $this->lastError[$methodName] : null;
|
||||
}
|
||||
/**
|
||||
* Method returning current result from Soap call
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResult()
|
||||
{
|
||||
return $this->result;
|
||||
}
|
||||
/**
|
||||
* Method setting current result from Soap call
|
||||
* @param mixed $result
|
||||
* @return AbstractSoapClientBase
|
||||
*/
|
||||
public function setResult($result)
|
||||
{
|
||||
$this->result = $result;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
269
core/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php
vendored
Normal file
269
core/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
abstract class AbstractStructArrayBase extends AbstractStructBase implements StructArrayInterface
|
||||
{
|
||||
/**
|
||||
* Array that contains values when only one parameter is set when calling __construct method
|
||||
* @var array
|
||||
*/
|
||||
protected $internArray;
|
||||
/**
|
||||
* Bool that tells if array is set or not
|
||||
* @var bool
|
||||
*/
|
||||
protected $internArrayIsArray;
|
||||
/**
|
||||
* Items index browser
|
||||
* @var int
|
||||
*/
|
||||
protected $internArrayOffset;
|
||||
/**
|
||||
* Method alias to count
|
||||
* @uses AbstractStructArrayBase::count()
|
||||
* @return int
|
||||
*/
|
||||
public function length()
|
||||
{
|
||||
return $this->count();
|
||||
}
|
||||
/**
|
||||
* Method returning item length, alias to length
|
||||
* @uses AbstractStructArrayBase::getInternArray()
|
||||
* @uses AbstractStructArrayBase::getInternArrayIsArray()
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return $this->getInternArrayIsArray() ? count($this->getInternArray()) : -1;
|
||||
}
|
||||
/**
|
||||
* Method returning the current element
|
||||
* @uses AbstractStructArrayBase::offsetGet()
|
||||
* @return mixed
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return $this->offsetGet($this->internArrayOffset);
|
||||
}
|
||||
/**
|
||||
* Method moving the current position to the next element
|
||||
* @uses AbstractStructArrayBase::getInternArrayOffset()
|
||||
* @uses AbstractStructArrayBase::setInternArrayOffset()
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
return $this->setInternArrayOffset($this->getInternArrayOffset() + 1);
|
||||
}
|
||||
/**
|
||||
* Method resetting itemOffset
|
||||
* @uses AbstractStructArrayBase::setInternArrayOffset()
|
||||
* @return int
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
return $this->setInternArrayOffset(0);
|
||||
}
|
||||
/**
|
||||
* Method checking if current itemOffset points to an existing item
|
||||
* @uses AbstractStructArrayBase::getInternArrayOffset()
|
||||
* @uses AbstractStructArrayBase::offsetExists()
|
||||
* @return bool
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return $this->offsetExists($this->getInternArrayOffset());
|
||||
}
|
||||
/**
|
||||
* Method returning current itemOffset value, alias to getInternArrayOffset
|
||||
* @uses AbstractStructArrayBase::getInternArrayOffset()
|
||||
* @return int
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
return $this->getInternArrayOffset();
|
||||
}
|
||||
/**
|
||||
* Method alias to offsetGet
|
||||
* @see AbstractStructArrayBase::offsetGet()
|
||||
* @uses AbstractStructArrayBase::offsetGet()
|
||||
* @param int $index
|
||||
* @return mixed
|
||||
*/
|
||||
public function item($index)
|
||||
{
|
||||
return $this->offsetGet($index);
|
||||
}
|
||||
/**
|
||||
* Default method adding item to array
|
||||
* @uses AbstractStructArrayBase::getAttributeName()
|
||||
* @uses AbstractStructArrayBase::__toString()
|
||||
* @uses AbstractStructArrayBase::_set()
|
||||
* @uses AbstractStructArrayBase::_get()
|
||||
* @uses AbstractStructArrayBase::setInternArray()
|
||||
* @uses AbstractStructArrayBase::setInternArrayIsArray()
|
||||
* @uses AbstractStructArrayBase::setInternArrayOffset()
|
||||
* @param mixed $item value
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function add($item)
|
||||
{
|
||||
// init array
|
||||
if (!is_array($this->_get($this->getAttributeName()))) {
|
||||
$this->_set($this->getAttributeName(), []);
|
||||
}
|
||||
// current array
|
||||
$currentArray = $this->_get($this->getAttributeName());
|
||||
array_push($currentArray, $item);
|
||||
$this
|
||||
->_set($this->getAttributeName(), $currentArray)
|
||||
->setInternArray($currentArray)
|
||||
->setInternArrayIsArray(true)
|
||||
->setInternArrayOffset(0);
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method returning the first item
|
||||
* @uses AbstractStructArrayBase::item()
|
||||
* @return mixed
|
||||
*/
|
||||
public function first()
|
||||
{
|
||||
return $this->item(0);
|
||||
}
|
||||
/**
|
||||
* Method returning the last item
|
||||
* @uses AbstractStructArrayBase::item()
|
||||
* @uses AbstractStructArrayBase::length()
|
||||
* @return mixed
|
||||
*/
|
||||
public function last()
|
||||
{
|
||||
return $this->item($this->length() - 1);
|
||||
}
|
||||
/**
|
||||
* Method testing index in item
|
||||
* @uses AbstractStructArrayBase::getInternArrayIsArray()
|
||||
* @uses AbstractStructArrayBase::getInternArray()
|
||||
* @param int $offset
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return ($this->getInternArrayIsArray() && array_key_exists($offset, $this->getInternArray()));
|
||||
}
|
||||
/**
|
||||
* Method returning the item at "index" value
|
||||
* @uses AbstractStructArrayBase::offsetExists()
|
||||
* @param int $offset
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->offsetExists($offset) ? $this->internArray[$offset] : null;
|
||||
}
|
||||
/**
|
||||
* Method setting value at offset
|
||||
* @param mixed $offset
|
||||
* @param mixed $value
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$this->internArray[$offset] = $value;
|
||||
return $this->_set($this->getAttributeName(), $this->internArray);
|
||||
}
|
||||
/**
|
||||
* Method unsetting value at offset
|
||||
* @param mixed $offset
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
if ($this->offsetExists($offset)) {
|
||||
unset($this->internArray[$offset]);
|
||||
$this->_set($this->getAttributeName(), $this->internArray);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method returning intern array to iterate trough
|
||||
* @return array
|
||||
*/
|
||||
public function getInternArray()
|
||||
{
|
||||
return $this->internArray;
|
||||
}
|
||||
/**
|
||||
* Method setting intern array to iterate trough
|
||||
* @param array $internArray
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function setInternArray($internArray)
|
||||
{
|
||||
$this->internArray = $internArray;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method returnint intern array index when iterating trough
|
||||
* @return int
|
||||
*/
|
||||
public function getInternArrayOffset()
|
||||
{
|
||||
return $this->internArrayOffset;
|
||||
}
|
||||
/**
|
||||
* Method initiating internArray
|
||||
* @uses AbstractStructArrayBase::setInternArray()
|
||||
* @uses AbstractStructArrayBase::setInternArrayOffset()
|
||||
* @uses AbstractStructArrayBase::setInternArrayIsArray()
|
||||
* @uses AbstractStructArrayBase::getAttributeName()
|
||||
* @uses AbstractStructArrayBase::initInternArray()
|
||||
* @uses AbstractStructArrayBase::__toString()
|
||||
* @param array $array the array to iterate trough
|
||||
* @param bool $internCall indicates that methods is calling itself
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function initInternArray($array = [], $internCall = false)
|
||||
{
|
||||
if (is_array($array) && count($array) > 0) {
|
||||
$this
|
||||
->setInternArray($array)
|
||||
->setInternArrayOffset(0)
|
||||
->setInternArrayIsArray(true);
|
||||
} elseif (!$internCall && property_exists($this, $this->getAttributeName())) {
|
||||
$this->initInternArray($this->_get($this->getAttributeName()), true);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method setting intern array offset when iterating trough
|
||||
* @param int $internArrayOffset
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function setInternArrayOffset($internArrayOffset)
|
||||
{
|
||||
$this->internArrayOffset = $internArrayOffset;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Method returning true if intern array is an actual array
|
||||
* @return bool
|
||||
*/
|
||||
public function getInternArrayIsArray()
|
||||
{
|
||||
return $this->internArrayIsArray;
|
||||
}
|
||||
/**
|
||||
* Method setting if intern array is an actual array
|
||||
* @param bool $internArrayIsArray
|
||||
* @return AbstractStructArrayBase
|
||||
*/
|
||||
public function setInternArrayIsArray($internArrayIsArray = false)
|
||||
{
|
||||
$this->internArrayIsArray = $internArrayIsArray;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
62
core/vendor/wsdltophp/packagebase/src/AbstractStructBase.php
vendored
Normal file
62
core/vendor/wsdltophp/packagebase/src/AbstractStructBase.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
abstract class AbstractStructBase implements StructInterface, \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* Returns the properties of this object
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return \get_object_vars($this);
|
||||
}
|
||||
/**
|
||||
* Generic method called when an object has been exported with var_export() functions
|
||||
* It allows to return an object instantiated with the values
|
||||
* @uses AbstractStructBase::_set()
|
||||
* @param array $array the exported values
|
||||
* @return Struct
|
||||
*/
|
||||
public static function __set_state(array $array)
|
||||
{
|
||||
$className = get_called_class();
|
||||
$object = new $className();
|
||||
foreach ($array as $name => $value) {
|
||||
$object->_set($name, $value);
|
||||
}
|
||||
return $object;
|
||||
}
|
||||
/**
|
||||
* Generic method setting value
|
||||
* @throws \InvalidArgumentException
|
||||
* @param string $name property name to set
|
||||
* @param mixed $value property value to use
|
||||
* @return Struct
|
||||
*/
|
||||
public function _set($name, $value)
|
||||
{
|
||||
$setMethod = 'set' . ucfirst($name);
|
||||
if (method_exists($this, $setMethod)) {
|
||||
$this->$setMethod($value);
|
||||
} else {
|
||||
throw new \InvalidArgumentException(sprintf('Setter does not exist for "%s" property', $name));
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Generic method getting value
|
||||
* @throws \InvalidArgumentException
|
||||
* @param string $name property name to get
|
||||
* @return mixed
|
||||
*/
|
||||
public function _get($name)
|
||||
{
|
||||
$getMethod = 'get' . ucfirst($name);
|
||||
if (method_exists($this, $getMethod)) {
|
||||
return $this->$getMethod();
|
||||
}
|
||||
throw new \InvalidArgumentException(sprintf('Getter does not exist for "%s" property', $name));
|
||||
}
|
||||
}
|
||||
202
core/vendor/wsdltophp/packagebase/src/SoapClientInterface.php
vendored
Normal file
202
core/vendor/wsdltophp/packagebase/src/SoapClientInterface.php
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
interface SoapClientInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_SOAP_CLIENT_CLASS = '\SoapClient';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const OPTION_PREFIX = 'wsdl_';
|
||||
/**
|
||||
* Option key to define WSDL authentication
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_AUTHENTICATION = 'wsdl_authentication';
|
||||
/**
|
||||
* Option key to define WSDL cache_wsdl
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_CACHE_WSDL = 'wsdl_cache_wsdl';
|
||||
/**
|
||||
* Option key to define WSDL classmap
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_CLASSMAP = 'wsdl_classmap';
|
||||
/**
|
||||
* Option key to define WSDL compression
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_COMPRESSION = 'wsdl_compression';
|
||||
/**
|
||||
* Option key to define WSDL connection_timeout
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_CONNECTION_TIMEOUT = 'wsdl_connection_timeout';
|
||||
/**
|
||||
* Option key to define WSDL encoding
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_ENCODING = 'wsdl_encoding';
|
||||
/**
|
||||
* Option key to define WSDL exceptions
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_EXCEPTIONS = 'wsdl_exceptions';
|
||||
/**
|
||||
* Option key to define WSDL features
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_FEATURES = 'wsdl_features';
|
||||
/**
|
||||
* Option key to define WSDL keep_alive
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_KEEP_ALIVE = 'wsdl_keep_alive';
|
||||
/**
|
||||
* Option key to define WSDL local_cert
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_LOCAL_CERT = 'wsdl_local_cert';
|
||||
/**
|
||||
* Option key to define WSDL location
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_LOCATION = 'wsdl_location';
|
||||
/**
|
||||
* Option key to define WSDL login
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_LOGIN = 'wsdl_login';
|
||||
/**
|
||||
* Option key to define WSDL passphrase
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_PASSPHRASE = 'wsdl_passphrase';
|
||||
/**
|
||||
* Option key to define WSDL password
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_PASSWORD = 'wsdl_password';
|
||||
/**
|
||||
* Option key to define WSDL proxy_host
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_PROXY_HOST = 'wsdl_proxy_host';
|
||||
/**
|
||||
* Option key to define WSDL proxy_login
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_PROXY_LOGIN = 'wsdl_proxy_login';
|
||||
/**
|
||||
* Option key to define WSDL proxy_password
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_PROXY_PASSWORD = 'wsdl_proxy_password';
|
||||
/**
|
||||
* Option key to define WSDL proxy_port
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_PROXY_PORT = 'wsdl_proxy_port';
|
||||
/**
|
||||
* Option key to define WSDL soap_version
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_SOAP_VERSION = 'wsdl_soap_version';
|
||||
/**
|
||||
* Option key to define WSDL ssl_method
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_SSL_METHOD = 'wsdl_ssl_method';
|
||||
/**
|
||||
* Option key to define WSDL stream_context
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_STREAM_CONTEXT = 'wsdl_stream_context';
|
||||
/**
|
||||
* Option key to define WSDL style
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_STYLE = 'wsdl_style';
|
||||
/**
|
||||
* Option key to define WSDL trace option
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_TRACE = 'wsdl_trace';
|
||||
/**
|
||||
* Option key to define WSDL typemap
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_TYPEMAP = 'wsdl_typemap';
|
||||
/**
|
||||
* Option key to define WSDL url
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_URL = 'wsdl_url';
|
||||
/**
|
||||
* Option key to define WSDL uri
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_URI = 'wsdl_uri';
|
||||
/**
|
||||
* Option key to define WSDL use
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_USE = 'wsdl_use';
|
||||
/**
|
||||
* Option key to define WSDL user_agent
|
||||
* @var string
|
||||
*/
|
||||
const WSDL_USER_AGENT = 'wsdl_user_agent';
|
||||
/**
|
||||
* Constructor
|
||||
* @uses SoapClientInterface::setLastError()
|
||||
* @uses SoapClientInterface::initSoapClient()
|
||||
* @param array $wsdlOptions
|
||||
* @param bool $resetSoapClient allows to disable the SoapClient redefinition
|
||||
*/
|
||||
public function __construct(array $wsdlOptions = [], $resetSoapClient = true);
|
||||
/**
|
||||
* Static method getting current SoapClient
|
||||
* @return \SoapClient
|
||||
*/
|
||||
public static function getSoapClient();
|
||||
/**
|
||||
* Sets a SoapHeader to send
|
||||
* For more information, please read the online documentation on {@link http://www.php.net/manual/en/class.soapheader.php}
|
||||
* @param string $nameSpace SoapHeader namespace
|
||||
* @param string $name SoapHeader name
|
||||
* @param mixed $data SoapHeader data
|
||||
* @param bool $mustUnderstand
|
||||
* @param string $actor
|
||||
* @return SoapClientInterface
|
||||
*/
|
||||
public function setSoapHeader($nameSpace, $name, $data, $mustUnderstand = false, $actor = null);
|
||||
/**
|
||||
* Method returning last errors occured during the calls
|
||||
* @return array
|
||||
*/
|
||||
public function getLastError();
|
||||
/**
|
||||
* Method saving the last error returned by the SoapClient
|
||||
* @param string $methodName the method called when the error occurred
|
||||
* @param \SoapFault $soapFault l'objet de l'erreur
|
||||
* @return SoapClientInterface
|
||||
*/
|
||||
public function saveLastError($methodName, \SoapFault $soapFault);
|
||||
/**
|
||||
* Method returning current result from Soap call
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResult();
|
||||
/**
|
||||
* Method setting current result from Soap call
|
||||
* @param mixed $result
|
||||
* @return SoapClientInterface
|
||||
*/
|
||||
public function setResult($result);
|
||||
}
|
||||
13
core/vendor/wsdltophp/packagebase/src/StructArrayInterface.php
vendored
Normal file
13
core/vendor/wsdltophp/packagebase/src/StructArrayInterface.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
interface StructArrayInterface extends StructInterface, \ArrayAccess, \Iterator, \Countable
|
||||
{
|
||||
/**
|
||||
* Method returning alone attribute name when class is *array* type
|
||||
* This method has been overridden in real-array struct class
|
||||
* @return string
|
||||
*/
|
||||
public function getAttributeName();
|
||||
}
|
||||
14
core/vendor/wsdltophp/packagebase/src/StructInterface.php
vendored
Normal file
14
core/vendor/wsdltophp/packagebase/src/StructInterface.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
interface StructInterface
|
||||
{
|
||||
/**
|
||||
* Generic method called when an object has been exported with var_export() functions
|
||||
* It allows to return an object instantiated with the values
|
||||
* @param array $array the exported values
|
||||
* @return StructInterface
|
||||
*/
|
||||
public static function __set_state(array $array);
|
||||
}
|
||||
42
core/vendor/wsdltophp/packagebase/src/Utils.php
vendored
Normal file
42
core/vendor/wsdltophp/packagebase/src/Utils.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase;
|
||||
|
||||
class Utils
|
||||
{
|
||||
/**
|
||||
* Returns a XML string content as a DOMDocument or as a formated XML string
|
||||
* @throws \InvalidArgumentException
|
||||
* @param string $string
|
||||
* @param bool $asDomDocument
|
||||
* @return \DOMDocument|string|null
|
||||
*/
|
||||
public static function getFormatedXml($string, $asDomDocument = false)
|
||||
{
|
||||
if (!is_null($string)) {
|
||||
$domDocument = self::getDOMDocument($string);
|
||||
return $asDomDocument ? $domDocument : $domDocument->saveXML();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* @param string $string
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \DOMDocument
|
||||
*/
|
||||
public static function getDOMDocument($string)
|
||||
{
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->formatOutput = true;
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->resolveExternals = false;
|
||||
$dom->substituteEntities = false;
|
||||
$dom->validateOnParse = false;
|
||||
try {
|
||||
$dom->loadXML($string);
|
||||
} catch (\Exception $exception) {
|
||||
throw new \InvalidArgumentException('XML string is invalid', $exception->getCode(), $exception);
|
||||
}
|
||||
return $dom;
|
||||
}
|
||||
}
|
||||
47
core/vendor/wsdltophp/packagebase/tests/Client.php
vendored
Executable file
47
core/vendor/wsdltophp/packagebase/tests/Client.php
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
class Client extends \SoapClient
|
||||
{
|
||||
public function __getLastRequest()
|
||||
{
|
||||
return file_get_contents(__DIR__ . '/resources/oneline.xml');
|
||||
}
|
||||
public function __getLastResponse()
|
||||
{
|
||||
return file_get_contents(__DIR__ . '/resources/oneline.xml');
|
||||
}
|
||||
public function __getLastRequestHeaders()
|
||||
{
|
||||
return "X-Header-1: valud-1\r\n".
|
||||
"X-Header-2: valud-2\r\n".
|
||||
"X-Header-Date: 2015-03-02T21:36:87\r\n".
|
||||
"X-Header-Content-Type: text/xml; charset=utf-8\r\n";
|
||||
}
|
||||
public function getLastRequestHeadersAsArray()
|
||||
{
|
||||
return array(
|
||||
'X-Header-1' => 'valud-1',
|
||||
'X-Header-2' => 'valud-2',
|
||||
'X-Header-Date' => '2015-03-02T21:36:87',
|
||||
'X-Header-Content-Type' => 'text/xml; charset=utf-8',
|
||||
);
|
||||
}
|
||||
public function __getLastResponseHeaders()
|
||||
{
|
||||
return "X-Header-1: valud-1\r\n".
|
||||
"X-Header-2: valud-2\r\n".
|
||||
"X-Header-Date: 2015-03-02T21:36:87\r\n".
|
||||
"X-Header-Content-Type: text/xml; charset=utf-8\r\n";
|
||||
}
|
||||
public function getLastResponseHeadersAsArray()
|
||||
{
|
||||
return array(
|
||||
'X-Header-1' => 'valud-1',
|
||||
'X-Header-2' => 'valud-2',
|
||||
'X-Header-Date' => '2015-03-02T21:36:87',
|
||||
'X-Header-Content-Type' => 'text/xml; charset=utf-8',
|
||||
);
|
||||
}
|
||||
}
|
||||
32
core/vendor/wsdltophp/packagebase/tests/SoapClient.php
vendored
Executable file
32
core/vendor/wsdltophp/packagebase/tests/SoapClient.php
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
use WsdlToPhp\PackageBase\AbstractSoapClientBase;
|
||||
|
||||
class SoapClient extends AbstractSoapClientBase
|
||||
{
|
||||
public function getSoapClientClassName($soapClientClassName = null)
|
||||
{
|
||||
return parent::getSoapClientClassName(empty($soapClientClassName) ? '\WsdlToPhp\PackageBase\Tests\Client' : $soapClientClassName);
|
||||
}
|
||||
/**
|
||||
* @return Client
|
||||
*/
|
||||
public static function getSoapClient()
|
||||
{
|
||||
return parent::getSoapClient();
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
try {
|
||||
self::getSoapClient()->search();
|
||||
} catch (\SoapFault $soapFault) {
|
||||
$this->setResult(null);
|
||||
$this->saveLastError(__METHOD__, $soapFault);
|
||||
}
|
||||
}
|
||||
}
|
||||
532
core/vendor/wsdltophp/packagebase/tests/SoapClientTest.php
vendored
Executable file
532
core/vendor/wsdltophp/packagebase/tests/SoapClientTest.php
vendored
Executable file
@@ -0,0 +1,532 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
use WsdlToPhp\PackageBase\Utils;
|
||||
use WsdlToPhp\PackageBase\Tests\SoapClient;
|
||||
|
||||
class SoapClientTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSoapClientName()
|
||||
{
|
||||
$soapClient = new SoapClient();
|
||||
|
||||
$this->assertSame('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClientClassName());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSoapClientNameDefault()
|
||||
{
|
||||
$soapClient = new SoapClient();
|
||||
|
||||
$this->assertSame('\SoapClient', $soapClient->getSoapClientClassName('\WsdlToPhp\PackageBase\Tests\Clien'));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSoapClient()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertInstanceOf('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClient());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetLocation()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$soapClient->setLocation('http://api.bing.net:80/soap.asm');
|
||||
|
||||
$this->assertSame('http://api.bing.net:80/soap.asm', $soapClient->getSoapClient()->location);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testLocationOption()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
SoapClient::WSDL_LOCATION => 'http://api.bing.net:80/soap.asm',
|
||||
));
|
||||
|
||||
$this->assertSame('http://api.bing.net:80/soap.asm', $soapClient->getSoapClient()->location);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastRequestAsString()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertSame(Utils::getFormatedXml(file_get_contents(__DIR__ . '/resources/oneline.xml')), $soapClient->getLastRequest(false));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastRequestAsDomDocument()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastRequest(true));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastResponseAsString()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertSame(Utils::getFormatedXml(file_get_contents(__DIR__ . '/resources/oneline.xml')), $soapClient->getLastResponse(false));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastResponseAsDomDocument()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastResponse(true));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastRequestHeadersAsString()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertSame($soapClient->getSoapClient()->__getLastRequestHeaders(), $soapClient->getLastRequestHeaders(false));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastRequestHeadersAsArray()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertSame($soapClient->getSoapClient()->getLastRequestHeadersAsArray(), $soapClient->getLastRequestHeaders(true));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastResponseHeadersAsString()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertSame($soapClient->getSoapClient()->__getLastResponseHeaders(), $soapClient->getLastResponseHeaders(false));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetLastResponseHeadersAsArray()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertSame($soapClient->getSoapClient()->getLastResponseHeadersAsArray(), $soapClient->getLastResponseHeaders(true));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetGetLastErrorForMethod()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
// this call should fail as no parameter is defined in the request
|
||||
$soapClient->search();
|
||||
|
||||
$this->assertInstanceOf('\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetGetLastError()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
// this call should fail as no parameter is defined in the request
|
||||
$soapClient->search();
|
||||
|
||||
$this->assertCount(1, $soapClient->getLastError());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetGetResult()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
// this call should fail as no parameter is defined in the request
|
||||
$soapClient->search();
|
||||
|
||||
$this->assertNull($soapClient->getResult());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetHeaders()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-Name', 'X-Header-Value'));
|
||||
|
||||
$this->assertTrue(is_resource(SoapClient::getSoapClient()->_stream_context));
|
||||
|
||||
$o = stream_context_get_options(SoapClient::getSoapClient()->_stream_context);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-Name: X-Header-Value') !== false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetHeadersOnExistingHeaders()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-Name', 'X-Header-Value'));
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-ID', 'X-Header-ID-Value'));
|
||||
|
||||
$this->assertTrue(is_resource(SoapClient::getSoapClient()->_stream_context));
|
||||
|
||||
$o = stream_context_get_options(SoapClient::getSoapClient()->_stream_context);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-Name: X-Header-Value') !== false);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-ID: X-Header-ID-Value') !== false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetHeadersOnExistingHttpsHeaders()
|
||||
{
|
||||
$streamContext = stream_context_create(array(
|
||||
'https' => array(
|
||||
'header' => array(
|
||||
'X-HEADER' => 'X-VALUE',
|
||||
),
|
||||
),
|
||||
));
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
SoapClient::WSDL_STREAM_CONTEXT => $streamContext,
|
||||
));
|
||||
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-Name', 'X-Header-Value'));
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-ID', 'X-Header-ID-Value'));
|
||||
|
||||
$this->assertTrue(is_resource(SoapClient::getSoapClient()->_stream_context));
|
||||
|
||||
$o = stream_context_get_options(SoapClient::getSoapClient()->_stream_context);
|
||||
$this->assertSame(array(
|
||||
'header' => array(
|
||||
'X-HEADER' => 'X-VALUE',
|
||||
),
|
||||
), $o['https']);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-Name: X-Header-Value') !== false);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-ID: X-Header-ID-Value') !== false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetHeadersOnExistingHttpHeaders()
|
||||
{
|
||||
$streamContext = stream_context_create(array(
|
||||
'http' => array(
|
||||
'Auth' => array(
|
||||
'X-HEADER' => 'X-VALUE',
|
||||
),
|
||||
),
|
||||
));
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
SoapClient::WSDL_STREAM_CONTEXT => $streamContext,
|
||||
));
|
||||
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-Name', 'X-Header-Value'));
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-ID', 'X-Header-ID-Value'));
|
||||
|
||||
$this->assertTrue(is_resource(SoapClient::getSoapClient()->_stream_context));
|
||||
|
||||
$o = stream_context_get_options(SoapClient::getSoapClient()->_stream_context);
|
||||
$this->assertSame(array(
|
||||
'X-HEADER' => 'X-VALUE',
|
||||
), $o['http']['Auth']);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-Name: X-Header-Value') !== false);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-ID: X-Header-ID-Value') !== false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetStreamContext()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-Name', 'X-Header-Value'));
|
||||
|
||||
$this->assertTrue(is_resource($soapClient->getStreamContext()));
|
||||
|
||||
$o = stream_context_get_options($soapClient->getStreamContext());
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-Name: X-Header-Value') !== false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetStreamContextAsNull()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
if (PHP_VERSION_ID < 70013) {
|
||||
$this->assertNull($soapClient->getStreamContext());
|
||||
} else {
|
||||
$this->assertTrue(is_resource($soapClient->getStreamContext()));
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetHeadersOnExistingHttpHeadersWithGetStreamContextOptions()
|
||||
{
|
||||
$streamContext = stream_context_create(array(
|
||||
'http' => array(
|
||||
'Auth' => array(
|
||||
'X-HEADER' => 'X-VALUE',
|
||||
),
|
||||
),
|
||||
));
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
SoapClient::WSDL_STREAM_CONTEXT => $streamContext,
|
||||
));
|
||||
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-Name', 'X-Header-Value'));
|
||||
$this->assertTrue($soapClient->setHttpHeader('X-Header-ID', 'X-Header-ID-Value'));
|
||||
|
||||
$this->assertTrue(is_resource($soapClient->getStreamContext()));
|
||||
|
||||
$o = $soapClient->getStreamContextOptions();
|
||||
$this->assertSame(array(
|
||||
'X-HEADER' => 'X-VALUE',
|
||||
), $o['http']['Auth']);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-Name: X-Header-Value') !== false);
|
||||
$this->assertTrue(strpos($o['http']['header'], 'X-Header-ID: X-Header-ID-Value') !== false);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetSoapHeader()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$soapClient->setSoapHeader('urn:namespace', 'HeaderAuth', 'the-data', false, null);
|
||||
|
||||
$this->assertEquals(array(
|
||||
new \SoapHeader('urn:namespace', 'HeaderAuth', 'the-data', false),
|
||||
), SoapClient::getSoapClient()->__default_headers);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetSoapHeaderModified()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$soapClient->setSoapHeader('urn:namespace', 'HeaderAuth', 'the-data', false, null);
|
||||
$soapClient->setSoapHeader('urn:namespace', 'HeaderAuth', 'the-data-modified', false, null);
|
||||
|
||||
$this->assertEquals(new \SoapHeader('urn:namespace', 'HeaderAuth', 'the-data-modified', false), array_pop(SoapClient::getSoapClient()->__default_headers));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetSoapActor()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
|
||||
SoapClient::WSDL_CLASSMAP => self::classMap(),
|
||||
));
|
||||
|
||||
$soapClient->setSoapHeader('urn:namespace', 'HeaderAuth', 'the-data', false, 'actor');
|
||||
|
||||
$this->assertEquals(array(
|
||||
new \SoapHeader('urn:namespace', 'HeaderAuth', 'the-data', false, 'actor'),
|
||||
), SoapClient::getSoapClient()->__default_headers);
|
||||
}
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function classMap()
|
||||
{
|
||||
return array (
|
||||
'AdultOption' => 'ApiEnumAdultOption',
|
||||
'ArrayOfDeepLink' => 'ApiStructArrayOfDeepLink',
|
||||
'ArrayOfError' => 'ApiStructArrayOfError',
|
||||
'ArrayOfImageResult' => 'ApiStructArrayOfImageResult',
|
||||
'ArrayOfInstantAnswerResult' => 'ApiStructArrayOfInstantAnswerResult',
|
||||
'ArrayOfMobileWebResult' => 'ApiStructArrayOfMobileWebResult',
|
||||
'ArrayOfMobileWebSearchOption' => 'ApiStructArrayOfMobileWebSearchOption',
|
||||
'ArrayOfNewsArticle' => 'ApiStructArrayOfNewsArticle',
|
||||
'ArrayOfNewsCollection' => 'ApiStructArrayOfNewsCollection',
|
||||
'ArrayOfNewsRelatedSearch' => 'ApiStructArrayOfNewsRelatedSearch',
|
||||
'ArrayOfNewsResult' => 'ApiStructArrayOfNewsResult',
|
||||
'ArrayOfRelatedSearchResult' => 'ApiStructArrayOfRelatedSearchResult',
|
||||
'ArrayOfSearchOption' => 'ApiStructArrayOfSearchOption',
|
||||
'ArrayOfSourceType' => 'ApiStructArrayOfSourceType',
|
||||
'ArrayOfSpellResult' => 'ApiStructArrayOfSpellResult',
|
||||
'ArrayOfString' => 'ApiStructArrayOfString',
|
||||
'ArrayOfVideoResult' => 'ApiStructArrayOfVideoResult',
|
||||
'ArrayOfWebResult' => 'ApiStructArrayOfWebResult',
|
||||
'ArrayOfWebSearchOption' => 'ApiStructArrayOfWebSearchOption',
|
||||
'ArrayOfWebSearchTag' => 'ApiStructArrayOfWebSearchTag',
|
||||
'DeepLink' => 'ApiStructDeepLink',
|
||||
'Error' => 'ApiStructError',
|
||||
'ImageRequest' => 'ApiStructImageRequest',
|
||||
'ImageResponse' => 'ApiStructImageResponse',
|
||||
'ImageResult' => 'ApiStructImageResult',
|
||||
'InstantAnswerResponse' => 'ApiStructInstantAnswerResponse',
|
||||
'InstantAnswerResult' => 'ApiStructInstantAnswerResult',
|
||||
'MobileWebRequest' => 'ApiStructMobileWebRequest',
|
||||
'MobileWebResponse' => 'ApiStructMobileWebResponse',
|
||||
'MobileWebResult' => 'ApiStructMobileWebResult',
|
||||
'MobileWebSearchOption' => 'ApiEnumMobileWebSearchOption',
|
||||
'NewsArticle' => 'ApiStructNewsArticle',
|
||||
'NewsCollection' => 'ApiStructNewsCollection',
|
||||
'NewsRelatedSearch' => 'ApiStructNewsRelatedSearch',
|
||||
'NewsRequest' => 'ApiStructNewsRequest',
|
||||
'NewsResponse' => 'ApiStructNewsResponse',
|
||||
'NewsResult' => 'ApiStructNewsResult',
|
||||
'NewsSortOption' => 'ApiEnumNewsSortOption',
|
||||
'PhonebookRequest' => 'ApiStructPhonebookRequest',
|
||||
'PhonebookSortOption' => 'ApiEnumPhonebookSortOption',
|
||||
'Query' => 'ApiStructQuery',
|
||||
'RelatedSearchResponse' => 'ApiStructRelatedSearchResponse',
|
||||
'RelatedSearchResult' => 'ApiStructRelatedSearchResult',
|
||||
'SearchOption' => 'ApiEnumSearchOption',
|
||||
'SearchRequest' => 'ApiStructSearchRequest',
|
||||
'SearchResponse' => 'ApiStructSearchResponse',
|
||||
'SourceType' => 'ApiEnumSourceType',
|
||||
'SpellResponse' => 'ApiStructSpellResponse',
|
||||
'SpellResult' => 'ApiStructSpellResult',
|
||||
'Thumbnail' => 'ApiStructThumbnail',
|
||||
'TranslationRequest' => 'ApiStructTranslationRequest',
|
||||
'VideoRequest' => 'ApiStructVideoRequest',
|
||||
'VideoResponse' => 'ApiStructVideoResponse',
|
||||
'VideoResult' => 'ApiStructVideoResult',
|
||||
'VideoSortOption' => 'ApiEnumVideoSortOption',
|
||||
'WebRequest' => 'ApiStructWebRequest',
|
||||
'WebResponse' => 'ApiStructWebResponse',
|
||||
'WebResult' => 'ApiStructWebResult',
|
||||
'WebSearchOption' => 'ApiEnumWebSearchOption',
|
||||
'WebSearchTag' => 'ApiStructWebSearchTag',
|
||||
);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testInvalidNonWsdlModeMustNotCreateASoapInstanceForMissingUriAndLocationOptions()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => null,
|
||||
));
|
||||
|
||||
$this->assertNull(SoapClient::getSoapClient());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testInvalidNonWsdlModeMustNotCreateASoapInstanceForMissingLocationOption()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => null,
|
||||
SoapClient::WSDL_URI => 'http://api.bing.net:80/soap.asmx',
|
||||
));
|
||||
|
||||
$this->assertNull(SoapClient::getSoapClient());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testInvalidNonWsdlModeMustNotCreateASoapInstanceForMissingUriOption()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => null,
|
||||
SoapClient::WSDL_LOCATION => 'http://api.bing.net:80/soap.asmx',
|
||||
));
|
||||
|
||||
$this->assertNull(SoapClient::getSoapClient());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testInvalidNonWsdlModeMustCreateASoapInstanceWithUriAndLocationOptions()
|
||||
{
|
||||
$soapClient = new SoapClient(array(
|
||||
SoapClient::WSDL_URL => null,
|
||||
SoapClient::WSDL_LOCATION => 'http://api.bing.net:80/soap.asmx',
|
||||
SoapClient::WSDL_URI => 'http://api.bing.net:80/soap.asmx',
|
||||
));
|
||||
|
||||
$this->assertInstanceOf('\SoapClient', SoapClient::getSoapClient());
|
||||
}
|
||||
}
|
||||
23
core/vendor/wsdltophp/packagebase/tests/StructArrayObject.php
vendored
Executable file
23
core/vendor/wsdltophp/packagebase/tests/StructArrayObject.php
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
use WsdlToPhp\PackageBase\AbstractStructArrayBase;
|
||||
|
||||
class StructArrayObject extends AbstractStructArrayBase
|
||||
{
|
||||
public $foo;
|
||||
public function setFoo(array $foo = array())
|
||||
{
|
||||
$this->foo = $foo;
|
||||
return $this;
|
||||
}
|
||||
public function getFoo()
|
||||
{
|
||||
return $this->foo;
|
||||
}
|
||||
public function getAttributeName()
|
||||
{
|
||||
return 'foo';
|
||||
}
|
||||
}
|
||||
307
core/vendor/wsdltophp/packagebase/tests/StructArrayTest.php
vendored
Executable file
307
core/vendor/wsdltophp/packagebase/tests/StructArrayTest.php
vendored
Executable file
@@ -0,0 +1,307 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
class StructArrayTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetState()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$this->assertEquals($object, StructArrayObject::__set_state(array(
|
||||
'foo' => array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
),
|
||||
)));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetAttributeName()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$this->assertSame('foo', $object->getAttributeName());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testLength()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$object->initInternArray();
|
||||
$this->assertSame(3, $object->length());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$this->assertSame(3, $object->count());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testCurrent()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$this->assertSame('1', $object->current());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testNextKey()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$object->next();
|
||||
$this->assertSame(1, $object->key());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testRewind()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$object->next();
|
||||
$object->rewind();
|
||||
$this->assertSame(0, $object->key());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testValid()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$object->next();
|
||||
$this->assertTrue($object->valid());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testInValid()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$object
|
||||
->next()
|
||||
->next()
|
||||
->next()
|
||||
->next();
|
||||
$this->assertFalse($object->valid());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testItem()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object->initInternArray(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
));
|
||||
$object->next();
|
||||
$this->assertSame(2, $object->item(1));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testAdd()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertSame('1', $object->current());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testAddOnEmpty()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->add(4)
|
||||
->add(5)
|
||||
->add(6);
|
||||
$this->assertSame(4, $object->current());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testFirst()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertSame('1', $object->first());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testLast()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertSame(4, $object->last());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testOffsetExists()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertTrue($object->offsetExists(3));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testOffsetNotExists()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertFalse($object->offsetExists(4));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testOffsetGet()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertSame(4, $object->offsetGet(3));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testOffsetGetNull()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->add(4);
|
||||
$this->assertNull($object->offsetGet(4));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testOffsetSet()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->offsetSet(2, 4);
|
||||
$this->assertSame(4, $object->offsetGet(2));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testOffsetUnset()
|
||||
{
|
||||
$object = new StructArrayObject();
|
||||
$object
|
||||
->setFoo(array(
|
||||
'1',
|
||||
2,
|
||||
'3',
|
||||
))
|
||||
->initInternArray()
|
||||
->offsetUnset(2);
|
||||
$this->assertFalse($object->offsetExists(2));
|
||||
}
|
||||
}
|
||||
65
core/vendor/wsdltophp/packagebase/tests/StructBaseTest.php
vendored
Executable file
65
core/vendor/wsdltophp/packagebase/tests/StructBaseTest.php
vendored
Executable file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
class StructBase extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetState()
|
||||
{
|
||||
$object = new StructObject();
|
||||
$object
|
||||
->setBar('foo')
|
||||
->setFoo('bar');
|
||||
$this->assertEquals($object, StructObject::__set_state(array(
|
||||
'bar' => 'foo',
|
||||
'foo' => 'bar',
|
||||
)));
|
||||
}
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testSetStateException()
|
||||
{
|
||||
StructObject::__set_state(array(
|
||||
'bar' => 'foo',
|
||||
'foo' => 'bar',
|
||||
'sample' => 'data',
|
||||
));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testSetGet()
|
||||
{
|
||||
$object = new StructObject();
|
||||
$object
|
||||
->setBar('foo')
|
||||
->setFoo('bar');
|
||||
$this->assertSame('foo', $object->_get('bar'));
|
||||
}
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testSetGetWithException()
|
||||
{
|
||||
$object = new StructObject();
|
||||
$object
|
||||
->setBar('foo')
|
||||
->setFoo('bar');
|
||||
$object->_get('sample');
|
||||
}
|
||||
public function testJsonSerialize()
|
||||
{
|
||||
$object = new StructObject();
|
||||
$object
|
||||
->setBar('foo')
|
||||
->setFoo('bar');
|
||||
$this->assertSame([
|
||||
'foo' => 'bar',
|
||||
'bar' => 'foo',
|
||||
], $object->jsonSerialize());
|
||||
}
|
||||
}
|
||||
29
core/vendor/wsdltophp/packagebase/tests/StructObject.php
vendored
Executable file
29
core/vendor/wsdltophp/packagebase/tests/StructObject.php
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
use WsdlToPhp\PackageBase\AbstractStructBase;
|
||||
|
||||
class StructObject extends AbstractStructBase
|
||||
{
|
||||
public $foo;
|
||||
public $bar;
|
||||
public function setFoo($foo)
|
||||
{
|
||||
$this->foo = $foo;
|
||||
return $this;
|
||||
}
|
||||
public function getFoo()
|
||||
{
|
||||
return $this->foo;
|
||||
}
|
||||
public function setBar($bar)
|
||||
{
|
||||
$this->bar = $bar;
|
||||
return $this;
|
||||
}
|
||||
public function getBar()
|
||||
{
|
||||
return $this->bar;
|
||||
}
|
||||
}
|
||||
9
core/vendor/wsdltophp/packagebase/tests/TestCase.php
vendored
Executable file
9
core/vendor/wsdltophp/packagebase/tests/TestCase.php
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase as PHPUnitFrameworkTestCase;
|
||||
|
||||
abstract class TestCase extends PHPUnitFrameworkTestCase
|
||||
{
|
||||
}
|
||||
72
core/vendor/wsdltophp/packagebase/tests/UtilsTest.php
vendored
Executable file
72
core/vendor/wsdltophp/packagebase/tests/UtilsTest.php
vendored
Executable file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace WsdlToPhp\PackageBase\Tests;
|
||||
|
||||
use WsdlToPhp\PackageBase\Utils;
|
||||
|
||||
class UtilsTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetFormatedXmlAsString()
|
||||
{
|
||||
$this->assertEquals(file_get_contents(__DIR__ . '/resources/formated.xml'), Utils::getFormatedXml(file_get_contents(__DIR__ . '/resources/oneline.xml')));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetFormatedXmlAsDomDocument()
|
||||
{
|
||||
$this->assertInstanceOf('\DOMDocument', Utils::getFormatedXml(file_get_contents(__DIR__ . '/resources/oneline.xml'), true));
|
||||
}
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testGetFormatedXmlEmptyStringAsString()
|
||||
{
|
||||
Utils::getFormatedXml('');
|
||||
}
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testGetFormatedXmlEmptyStringAsDomDocument()
|
||||
{
|
||||
Utils::getFormatedXml('', true);
|
||||
}
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testGetFormatedXmlInvalidXmlAsDomDocument()
|
||||
{
|
||||
Utils::getFormatedXml('<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:img="http://ws.estesexpress.com/imageview" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.estesexpress.com/imageview" xml:lang="en"><root>', true);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetFormatedXmlNullAsString()
|
||||
{
|
||||
$this->assertNull(Utils::getFormatedXml(null));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetFormatedXmlNullAsDomDocument()
|
||||
{
|
||||
$this->assertNull(Utils::getFormatedXml(null, true));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testGetDOMDocument()
|
||||
{
|
||||
$this->assertInstanceOf('\DOMDocument', Utils::getDOMDocument(file_get_contents(__DIR__ . '/resources/oneline.xml')));
|
||||
}
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testGetDOMDocumentException()
|
||||
{
|
||||
$this->assertInstanceOf('\DOMDocument', Utils::getDOMDocument(''));
|
||||
}
|
||||
}
|
||||
490
core/vendor/wsdltophp/packagebase/tests/resources/bingsearch.wsdl
vendored
Executable file
490
core/vendor/wsdltophp/packagebase/tests/resources/bingsearch.wsdl
vendored
Executable file
@@ -0,0 +1,490 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tns="http://schemas.microsoft.com/LiveSearch/2008/03/Search" targetNamespace="http://schemas.microsoft.com/LiveSearch/2008/03/Search">
|
||||
<wsdl:types>
|
||||
<xsd:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/LiveSearch/2008/03/Search">
|
||||
<xsd:complexType name="SearchRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Version" type="xsd:string" default="2.2" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Market" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="UILanguage" type="xsd:string" />
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="Query" type="xsd:string" />
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="AppId" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Adult" type="tns:AdultOption" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Latitude" type="xsd:double" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Longitude" type="xsd:double" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Radius" type="xsd:double" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Options" type="tns:ArrayOfSearchOption" />
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="Sources" type="tns:ArrayOfSourceType" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Web" type="tns:WebRequest" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Image" type="tns:ImageRequest" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Phonebook" type="tns:PhonebookRequest" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Video" type="tns:VideoRequest" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="News" type="tns:NewsRequest" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="MobileWeb" type="tns:MobileWebRequest" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Translation" type="tns:TranslationRequest" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="AdultOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Off" />
|
||||
<xsd:enumeration value="Moderate" />
|
||||
<xsd:enumeration value="Strict" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="ArrayOfSearchOption">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="SearchOption" type="tns:SearchOption" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="SearchOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="DisableLocationDetection" />
|
||||
<xsd:enumeration value="EnableHighlighting" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="ArrayOfSourceType">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="SourceType" type="tns:SourceType" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="SourceType">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Spell" />
|
||||
<xsd:enumeration value="Web" />
|
||||
<xsd:enumeration value="Image" />
|
||||
<xsd:enumeration value="RelatedSearch" />
|
||||
<xsd:enumeration value="Phonebook" />
|
||||
<xsd:enumeration value="Showtimes" />
|
||||
<xsd:enumeration value="Weather" />
|
||||
<xsd:enumeration value="Video" />
|
||||
<xsd:enumeration value="Ad" />
|
||||
<xsd:enumeration value="XRank" />
|
||||
<xsd:enumeration value="InstantAnswer" />
|
||||
<xsd:enumeration value="News" />
|
||||
<xsd:enumeration value="QueryLocation" />
|
||||
<xsd:enumeration value="MobileWeb" />
|
||||
<xsd:enumeration value="Translation" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="WebRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Count" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="FileType" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Options" type="tns:ArrayOfWebSearchOption" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SearchTags" type="tns:ArrayOfString" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfWebSearchOption">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="WebSearchOption" type="tns:WebSearchOption" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="WebSearchOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="DisableHostCollapsing" />
|
||||
<xsd:enumeration value="DisableQueryAlterations" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="ArrayOfString">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="string" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ImageRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Count" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Filters" type="tns:ArrayOfString" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="PhonebookRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Count" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="FileType" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SortBy" type="tns:PhonebookSortOption" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="LocId" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Category" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="PhonebookSortOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Default" />
|
||||
<xsd:enumeration value="Relevance" />
|
||||
<xsd:enumeration value="Distance" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="VideoRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Count" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Filters" type="tns:ArrayOfString" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SortBy" type="tns:VideoSortOption" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="VideoSortOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Relevance" />
|
||||
<xsd:enumeration value="Date" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="NewsRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Count" type="xsd:unsignedInt" default="10" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="LocationOverride" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Category" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SortBy" type="tns:NewsSortOption" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="NewsSortOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Relevance" />
|
||||
<xsd:enumeration value="Date" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="MobileWebRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Count" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Options" type="tns:ArrayOfMobileWebSearchOption" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfMobileWebSearchOption">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="MobileWebSearchOption" type="tns:MobileWebSearchOption" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="MobileWebSearchOption">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="DisableHostCollapsing" />
|
||||
<xsd:enumeration value="DisableQueryAlterations" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="TranslationRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="SourceLanguage" type="xsd:string" />
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="TargetLanguage" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SearchResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="Version" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Query" type="tns:Query" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Spell" type="tns:SpellResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Web" type="tns:WebResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Image" type="tns:ImageResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="RelatedSearch" type="tns:RelatedSearchResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Video" type="tns:VideoResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="InstantAnswer" type="tns:InstantAnswerResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="News" type="tns:NewsResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="MobileWeb" type="tns:MobileWebResponse" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Errors" type="tns:ArrayOfError" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Query">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SearchTerms" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="AlteredQuery" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="AlterationOverrideQuery" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SpellResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Total" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfSpellResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfSpellResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="SpellResult" type="tns:SpellResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SpellResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Value" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="WebResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Total" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfWebResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfWebResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="WebResult" type="tns:WebResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="WebResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Description" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="CacheUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="DisplayUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="DateTime" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SearchTags" type="tns:ArrayOfWebSearchTag" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="DeepLinks" type="tns:ArrayOfDeepLink" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfWebSearchTag">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="WebSearchTag" type="tns:WebSearchTag" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="WebSearchTag">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Name" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Value" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfDeepLink">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DeepLink" type="tns:DeepLink" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="DeepLink">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ImageResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Total" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfImageResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfImageResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="ImageResult" type="tns:ImageResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ImageResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="MediaUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="DisplayUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Width" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Height" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="FileSize" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="ContentType" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Thumbnail" type="tns:Thumbnail" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Thumbnail">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="ContentType" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Width" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Height" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="FileSize" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="RunTime" type="xsd:unsignedInt" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="RelatedSearchResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfRelatedSearchResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfRelatedSearchResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="RelatedSearchResult" type="tns:RelatedSearchResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="RelatedSearchResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="VideoResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Total" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfVideoResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfVideoResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="VideoResult" type="tns:VideoResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="VideoResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="PlayUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SourceTitle" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="RunTime" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="ClickThroughPageUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="StaticThumbnail" type="tns:Thumbnail" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="InstantAnswerResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfInstantAnswerResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfInstantAnswerResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="InstantAnswerResult" type="tns:InstantAnswerResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="InstantAnswerResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="ContentType" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="ClickThroughUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Attribution" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="InstantAnswerSpecificData" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="NewsResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Total" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="RelatedSearches" type="tns:ArrayOfNewsRelatedSearch" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfNewsResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfNewsRelatedSearch">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="NewsRelatedSearch" type="tns:NewsRelatedSearch" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="NewsRelatedSearch">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfNewsResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="NewsResult" type="tns:NewsResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="NewsResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Source" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Snippet" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Date" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="BreakingNews" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="NewsCollections" type="tns:ArrayOfNewsCollection" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfNewsCollection">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="NewsCollection" type="tns:NewsCollection" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="NewsCollection">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Name" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="NewsArticles" type="tns:ArrayOfNewsArticle" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfNewsArticle">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="NewsArticle" type="tns:NewsArticle" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="NewsArticle">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Source" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Snippet" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Date" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="MobileWebResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Total" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Offset" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Results" type="tns:ArrayOfMobileWebResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfMobileWebResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="MobileWebResult" type="tns:MobileWebResult" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="MobileWebResult">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Title" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Description" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Url" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="DisplayUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="DateTime" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ArrayOfError">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="unbounded" name="Error" type="tns:Error" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Error">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Code" type="xsd:unsignedInt" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Message" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Parameter" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="Value" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="HelpUrl" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SourceType" type="xsd:string" />
|
||||
<xsd:element minOccurs="0" maxOccurs="1" name="SourceTypeErrorCode" type="xsd:unsignedInt" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="SearchRequest">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="parameters" type="tns:SearchRequest" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="SearchResponse">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="1" maxOccurs="1" name="parameters" type="tns:SearchResponse" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="SearchRequestMessage">
|
||||
<wsdl:part name="parameters" element="tns:SearchRequest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="SearchResponseMessage">
|
||||
<wsdl:part name="parameters" element="tns:SearchResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="BingPortType">
|
||||
<wsdl:operation name="Search">
|
||||
<wsdl:input message="tns:SearchRequestMessage" wsa:Action="http://schemas.microsoft.com/LiveSearch/2008/03/Search/BingPortType/SearchRequest" />
|
||||
<wsdl:output message="tns:SearchResponseMessage" wsa:Action="http://schemas.microsoft.com/LiveSearch/2008/03/Search/BingPortType/SearchResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="BingPortBinding" type="tns:BingPortType">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
|
||||
<wsdl:operation name="Search">
|
||||
<soap:operation soapAction="http://schemas.microsoft.com/LiveSearch/2008/03/Search/Search" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="BingService">
|
||||
<wsdl:port name="BingPort" binding="tns:BingPortBinding">
|
||||
<soap:address location="http://api.bing.net:80/soap.asmx" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
29
core/vendor/wsdltophp/packagebase/tests/resources/formated.xml
vendored
Executable file
29
core/vendor/wsdltophp/packagebase/tests/resources/formated.xml
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:img="http://ws.estesexpress.com/imageview" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.estesexpress.com/imageview" xml:lang="en">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">Available images response. Copyright 2007 Estes Express Lines, Inc.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:include schemaLocation="imageViewCommon.xsd"/>
|
||||
<xsd:element name="availResponse">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="img:requestID"/>
|
||||
<xsd:choice>
|
||||
<xsd:element name="success" type="img:SuccessType"/>
|
||||
<xsd:element name="errorMessage" type="img:ErrorMessageType"/>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:complexType name="DocumentsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element maxOccurs="10" name="document" type="img:DocumentType"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SuccessType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="search" type="img:SearchCriteriaType"/>
|
||||
<xsd:element name="documents" type="img:DocumentsType"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
1
core/vendor/wsdltophp/packagebase/tests/resources/oneline.xml
vendored
Executable file
1
core/vendor/wsdltophp/packagebase/tests/resources/oneline.xml
vendored
Executable file
@@ -0,0 +1 @@
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:img="http://ws.estesexpress.com/imageview" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.estesexpress.com/imageview" xml:lang="en"><xsd:annotation><xsd:documentation xml:lang="en">Available images response. Copyright 2007 Estes Express Lines, Inc.</xsd:documentation></xsd:annotation><xsd:include schemaLocation="imageViewCommon.xsd" /><xsd:element name="availResponse"><xsd:complexType><xsd:sequence><xsd:element ref="img:requestID" /><xsd:choice><xsd:element name="success" type="img:SuccessType" /><xsd:element name="errorMessage" type="img:ErrorMessageType" /></xsd:choice></xsd:sequence></xsd:complexType></xsd:element><xsd:complexType name="DocumentsType"><xsd:sequence><xsd:element maxOccurs="10" name="document" type="img:DocumentType" /></xsd:sequence></xsd:complexType><xsd:complexType name="SuccessType"><xsd:sequence><xsd:element name="search" type="img:SearchCriteriaType" /><xsd:element name="documents" type="img:DocumentsType" /></xsd:sequence></xsd:complexType></xsd:schema>
|
||||
Reference in New Issue
Block a user