Comments (2)
Hi @nicodax, thanks for your question. Right now, there isn't an endpoint that serves the WSDL file automatically but it would be a useful feature.
If you have an existing WSDL file that you'd like to serve from a given endpoint, you could add a resource to your configuration such as:
plugin: soap
resources:
- path: /wsdl
method: get
response:
file: ./your-file.wsdl
This will serve the content of the WSDL file on the http://<mock-server-address>/wsdl
endpoint.
from imposter.
Hi @outofcoffee, thanks for your response.
I tried your suggestion and had syntax troubles:
get_person_stub | 13:16:26 INFO i.g.i.Imposter - Starting mock engine 3.35.1
get_person_stub | 13:16:26 DEBUG i.g.i.c.u.ConfigUtil - Loading configuration file: ConfigReference(file=/opt/imposter/config/imposter_soap-config.yaml, configRoot=/opt/imposter/config)
get_person_stub | 13:16:27 DEBUG i.g.i.p.PluginManager - Loaded 9 plugin(s): [js-detector, store-detector, meta-detector, js-nashorn, store-inmem, config-detector, store-graphql, fake-data, soap]
get_person_stub | 13:16:28 ERROR i.v.c.i.l.c.VertxIsolatedDeployer - Failed in deploying verticle
get_person_stub | java.lang.RuntimeException: Error configuring plugin: soap
get_person_stub | at io.gatehill.imposter.plugin.PluginManagerImpl.configurePlugins(PluginManagerImpl.kt:133) ~[imposter-config-3.35.1.jar:?]
get_person_stub | at io.gatehill.imposter.plugin.PluginManagerImpl.startPlugins(PluginManagerImpl.kt:91) ~[imposter-config-3.35.1.jar:?]
get_person_stub | at io.gatehill.imposter.Imposter$start$1.invokeSuspend(Imposter.kt:132) ~[imposter-engine-3.35.1.jar:?]
get_person_stub | at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.9.10.jar:1.9.10-release-459]
get_person_stub | at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
get_person_stub | at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
get_person_stub | at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
get_person_stub | at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
get_person_stub | at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
get_person_stub | Caused by: java.lang.RuntimeException: Error loading plugin config: LoadedConfig(ref=ConfigReference(file=/opt/imposter/config/imposter_soap-config.yaml, configRoot=/opt/imposter/config), serialised=plugin: soap
get_person_stub | wsdlFile: person_service.wsdl
get_person_stub |
get_person_stub | resources:
get_person_stub | - path: /wsdl
get_person_stub | method: get
get_person_stub | response:
get_person_stub | file: ./person_service.wsdl
... Rest of the configuration ...
get_person_stub | at io.gatehill.imposter.plugin.config.ConfiguredPlugin.loadConfiguration(ConfiguredPlugin.kt:79) ~[imposter-engine-3.35.1.jar:?]
get_person_stub | at io.gatehill.imposter.plugin.PluginManagerImpl.configurePlugins(PluginManagerImpl.kt:130) ~[imposter-config-3.35.1.jar:?]
get_person_stub | ... 8 more
get_person_stub | Caused by: java.lang.RuntimeException: Error loading configuration file: /opt/imposter/config/imposter_soap-config.yaml, reason: Unrecognized field "method" (class io.gatehill.imposter.plugin.soap.config.SoapPluginResourceConfig), not marked as ignorable (9 known properties: "security", "response", "path", "capture", "operation", "eval", "soapAction", "binding", "requestBody"])
get_person_stub | at [Source: (StringReader); line: 6, column: 16] (through reference chain: io.gatehill.imposter.plugin.soap.config.SoapPluginConfig["resources"]->java.util.ArrayList[0]->io.gatehill.imposter.plugin.soap.config.SoapPluginResourceConfig["method"])
get_person_stub | at io.gatehill.imposter.config.util.ConfigUtil.loadPluginConfig(ConfigUtil.kt:320) ~[imposter-config-3.35.1.jar:?]
get_person_stub | at io.gatehill.imposter.plugin.config.ConfiguredPlugin.loadConfiguration(ConfiguredPlugin.kt:74) ~[imposter-engine-3.35.1.jar:?]
get_person_stub | at io.gatehill.imposter.plugin.PluginManagerImpl.configurePlugins(PluginManagerImpl.kt:130) ~[imposter-config-3.35.1.jar:?]
get_person_stub | ... 8 more
get_person_stub exited with code 0
It seems the method
field does not exist for the SOAP plugin. At least, I could not find mentions of it within the documentation.
What I did though was to create a second imposter YAML config file, using the REST plugin this time, and serving the wsdl file over a GET request:
plugin: rest
path: "/GetPersonService"
response:
file: person_service.wsdl
headers:
Content-Type: "text/xml"
This works as expected and we are now able to access the WSDL file directly from the imposter instance.
Closing this issue as it is now resolved.
Thanks !
from imposter.
Related Issues (20)
- NPE while parsing a WSDL with rpc/encoded style HOT 2
- Precompiling js script files fails from docker container HOT 6
- SOAP : WSDL with includes fails parsing HOT 1
- Autoreload when using docker and config files change HOT 2
- Support for RPC style SOAP services HOT 2
- Support XML attributes in SOAP request body XPath
- Unable to format data from store as JSON in javascript script handler HOT 11
- SQS plugin
- Scheduled steps
- SOAP: WSDL with targetNamespace and messages without namespace prefix parsing issue
- Plugin index file
- imposter-3.22.0.jar - REST request with content-type=multipart/form-data - how to access the parts ? Groovy script returns null body HOT 1
- Unable to match multiple values in request body using XPath in SOAP plugin HOT 5
- "Docker Official Image" on docker hub
- [QUESTION] Configuration example for providing security config for individual plugins and swagger UI HOT 2
- Trivy reports lots of vulnerabilities HOT 2
- Possibility to configure list params
- Nashorn Load no longer working with Graal HOT 2
- Enforce client version through User-Agent header HOT 2
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 imposter.