External SOAP Callout
Oracle Insurance Gateway supports synchronous SOAP calls without attachment over HTTP. Dynamic logic can be configured to send a SOAP message to an endpoint - configured as REST destination.
To get a clear understanding of how this can be achieved, consider the following sample dynamic logic - Data Collection Custom implementation
import groovy.xml.StreamingMarkupBuilder
import groovy.xml.XmlUtil
def builder = new StreamingMarkupBuilder()
def soapRequest = builder.bind
{ mkp.declareNamespace( "soapenv":"http://schemas.xmlsoap.org/soap/envelope/")
soapenv.Envelope() {
soapenv.Header(){}
soapenv.Body (){
xmlElement1(){
xmlElement2(
attribute1 : "Value attribute 1",
attribute2 : "Value attribute 2")}
}
}
}
String SOAPResponse = webTarget("SOAPOverHTTP")
.request()
.buildPost(new Entity(xmlBody1.toString(),MediaType.TEXT_XML_TYPE))
.invoke()
.readEntity
SOAPOverHTTP is configured as REST destination in the system.
Also, note that while sending SOAP message over HTTP through Oracle Insurance Gateway the media type is required to be set to "MediaType.TEXT_XML_TYPE"