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
New soap engine #197
Merged
Merged
New soap engine #197
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Dec 6, 2018
veewee
force-pushed
the
new-soap-engine
branch
from
December 14, 2018 13:10
24f71d0
to
1304d32
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables #65: Abstract all ext-soap interactions to a generic driver system.
Abstract ext-soap into a "driver".
This PR makes it possible to create new drivers that do not depend on ext-soap.
Migrating
Change your code generation configuration
The code generation configuration has changed:
As you can see, the WSDL and the soapOptions are moved to a new
ExtSoapOptions
class.The
ExtSoapEngineFactory
will create a driver based on those soap options and will configure theExtSoapClientHandle
by default.By providing this new driver system, it will be possible to generate code without ext-soap in the future.
For now, we only suppy the ext-soap driver.
Currently, we are using the default
ExtSoapClientHandle
in the engine.You could however change this ext-soap handler to the
HttPlugHandle
by using theExtSoapEngineFactory::fromOptionsWithHandler()
method.We've choosen to add the engine instead of the driver to the configuration for advanced future code generation features.
The code generation will work exactly as before. It will only use the new driver metadata implementation to detect methods and types.
Change your factories
Previously we used a lot of classes to get your client up and running.
We decided to remove both the
ClientFactory
andClientBuilder
and move the configuration to the generated factory.Most of the configuration is related to the ext-soap SoapClient and is now moved to a new
ExtSoapOptions
class.This new class is validated by a resolver. This way you will get a usefull error when you misconfigure one of the many soap options.
The newly introduced options class contains:
Based on the options, you can now create an
ExtSoapDriver
which is responsible for encoding / decoding soap requests.The
Handlers
are still in charge of doing the actual HTTP requests.Therefor, you'll have to configure following items directly on the Handler:
When both the driver and handler are configured, we can create a new engine.
Since there are a lot of possible configurations, an easy to use
ExtSoapEngineFactory
is added.This one can be used as a shortcut to easily create the engine.
You can transform your builder like one of the examples below:
As you can see, you can still apply the exact same configuration as before:
ExtSoapOptions
helper is added that makes it a lot easier to configure the ext-soap client.HandleInterface
Engine
which is injected into your client class.EventDispatcher
.Remove your custom client -factories, -builders, -constructors
Since we removed both the
ClientBuilder
andPhpro\SoapClient\ClientFactoryInterface
,you will have to move the logic to the new client factory as described above.
Both the builder and clientFactory are permanently removed and will never come back again.
We also changed the constructor of the Client class. It now accepts an
Engine
andEventDispatcher
.If you changed the constructor signature, you will have to take a look at this as well.
Change namespace of old plugins
One of the first possible ways of extending the soap-client was by adding plugins. Since these plugins are actually event subscribers, it is a better idea to name them EventSubscribers. This is also less confusing with the http-plug plugins which are actually HTTP middlewares.
If you are manually assigning the LogPlugin or ValidatorPlugin, you might need to change these lines as well. The plugins are moved to following locations:
TODO
xsd:simpleType
properties are resolved to non existing classes during code generation #218)