-
Notifications
You must be signed in to change notification settings - Fork 39
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
Ability to call client functions not wrapped in main class #36
Comments
Actually, there's getClient. It's just protected is all. I have considered making it public in the past, but decided not to, because I figured the main class might only be an obstacle for a developer with more custom needs. I don't think proxying all methods is a good idea, unless the wrapper function actually adds value (which is the case for the functions currently in there). Making the |
I think it it is more convenient to have the getClient method public. That way, there is a single access point to the api. This also prevents the consumer from dealing with the SecurityHeader. Are there any downsides in doing this? |
Probably only psychological. In other words, no :) |
On second thought, that would result in code like this (and wouldn't catch CIF exceptions): $request = new ComplexTypes\CompleteStatusRequest($message, $customer, $shipment);
// Query the webservice and return the result.
return $postnl->getClient('ShippingStatusClient')->completeStatus($request); Making the $request = new ComplexTypes\CompleteStatusRequest($message, $customer, $shipment);
// Query the webservice and return the result.
return $postnl->call('ShippingStatusClient', 'completeStatus', $request); If you agree then I'll patch it. |
That is probably better. Great work! |
In the Postnl class, there are setters to set the various clients. However, there are no getters for them. Because of this, there is no easy way to call some parts of the api. (For example, completeStatus from ShippingStatusClient).
Two possible fixes: Proxy all methods from each client in the Postnl class, or make the clients themselves accessible.
The text was updated successfully, but these errors were encountered: