Comments (5)
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 getClient
function public is probably the best solution.
from postnl.
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?
from postnl.
Are there any downsides in doing this?
Probably only psychological. In other words, no :)
from postnl.
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 call
method available would be preferable, and using that will result in something like this (AND have proper CIF error handling):
$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.
from postnl.
That is probably better. Great work!
from postnl.
Related Issues (20)
- Using an multi-colli HOT 3
- generate pick-up label HOT 1
- Getting all labels from an multi colli HOT 2
- Debugging HOT 1
- PostNL API (CIF) new platform (live in november 2018) HOT 3
- Errors in Confirming HOT 3
- Bug: new API GetNearestLocationsRequest HOT 13
- Undefined notices when parsing errors from webservice HOT 2
- Old API shutdown november 2018 HOT 7
- Get warnings HOT 16
- composer require dividebv/postnl HOT 3
- Multi collo shipment not working new API HOT 11
- CN23 forms for Customs HOT 1
- Hope someone can help me out GetNearestLocations
- Error Code 13308 "Due to the COVID-19 pandemic we currently cannot ship to this destination" HOT 1
- Update of PostNL API 2020 HOT 4
- How to post a email or smsnumber of customer... HOT 1
- Support for PHP 8 HOT 3
- GB is not EU anymore, please remove GB from PostNL->countryCodeMapping HOT 1
- HR is in EU, but not in countryCodeMapping variable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postnl.