spring-cloud-contract
spring-cloud-contract copied to clipboard
Feature request. SOAP DSL
Enhancement.
Hi everyone!
I'd like to suggest a feature to add DSL classes for easy SOAP contracts writing and providing a convenient standard. SOAP looks like the standard HTTP synchronous contracts but has specific constants.
Goal: To have a convenient DSL for SOAP contracts. To handle XML contracts properly because currently there are a few bugs and misleadings by refactoring code during the feature implementation
Target DSL example:
Contracts.make {
request {
soap {
url '/some/soap/url'
body (
equalToXml(
file('__files/example.xml')
)
)
}
}
response {
status 200
soap {
body(
file('__files/example-response.xml')
)
}
}
}
Another variant:
soap {
wsld '/some/soap/url.wsdl'
}
Closure soap
will incupsuliate http header Content-Type: text/xml and method POST on request and header Content-Type: text/xml on response
Why not just simple do a plain old xml ? Soap is nothing else but an XML
because it can be easier to understand one for some people with low tech expertize, incapsulate default constants and will fail on invalid (not xml) passed body to a contract on generating stub or test
add enhancement label, please
because it can be easier to understand one for some people with low tech expertize, incapsulate default constants and will fail on invalid (not xml) passed body to a contract on generating stub or test
we can describe it in the docs
- create a file with your example SOAP message
- pass the
contentType(applicationXml())
- read the contents of the body from file
- you're done
add enhancement label, please
I don't yet see this as an enhancement. Maybe it's just a documentation extension. WDYT @OlgaMaciaszek
BTW if you want to first chat about making an enhancement we can chat on Gitter if you want to https://gitter.im/spring-cloud/spring-cloud-contract
I agree with @marcingrzejszczak ; @artemptushkin would you like to contribute such a section to the documentation?
@OlgaMaciaszek I think you meant @artemptushkin ;)
yes. sorry for that. updated.
Okay, I'll add doc for SOAP to how to section, I guess. Maybe later we'll be back to dsl :)
adding my 2 cents, I think it may be worth to look at Apache Axis2, which offers highly comprehensive java support for SOAP. Some bits surely will be useful