Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure order of soap arguments based on function signature. #10

Merged
merged 3 commits into from
Nov 14, 2019

Conversation

Bouwdie
Copy link
Contributor

@Bouwdie Bouwdie commented Oct 22, 2019

When an associative array is passed it does not use the key for argument order.
This means that the following code passes the last_name as first argument,
whilst in the signature this is the second parameter.

$arguments = [
    'last_name' => 'Lastname',
    'first_name' => 'Firstname',
];

$results = $client->getAdapter()->call('complianceSearchPersons', $arguments);

In this merge request we are leveraging the __getFunctions from the native php soap-client and parse those for argument order.
We order the arguments according to the signature before sending them to the parent __soapCall.
In addition we validate if the method exists and log any arguments that are not in the signature.

When an associative array is passed it does not use the key for argument order.
This means that the following code passes the last_name as first argument,
whilst in the signature this is the second parameter.

```
$arguments = [
    'last_name' => 'Lastname',
    'first_name' => 'Firstname',
];

$results = $client->getAdapter()->call('complianceSearchPersons', $arguments);
```

In this merge request we are leveraging the __getFunctions from the native php soap-client and parse those for argument order.
We order the arguments according to the signature before sending them to the parent __soapCall.
In addition we validate if the method exists and log any arguments that are not in the signature.
@kanariezwart
Copy link
Contributor

@Bouwdie please update your branch with the latest master.

@kanariezwart
Copy link
Contributor

I updated the branch with master. Changes look good to me.
:octocat:

@kanariezwart kanariezwart merged commit 5548c5b into master Nov 14, 2019
@kanariezwart kanariezwart deleted the fix-soap-argument-ordering branch November 14, 2019 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants