I am trying to call a REST API, specifically the login API of Core DDRI(/v1/auth/login) inside process automation, I am following the ProcessModelling for AppWorks Platform 16.7 and I am doing the "Use HTTP connector to connect to an external RESTful webservice. Here is what I did so far.
- I created an XML Store Definition Document and an XML config containing this
<configurationsxmlns="http://httpconnector.opentext.com/1.0/configuration">
<connections>
<connection id="CORE-DDRI">
<url>
URL…
</url>
</connection>
</connections>
</configurations>
- Createdan HTTP Connector Application Connector
- Createda custom web service with one web service operation with an implementation ofsomething like this
<implementationxmlns="http://httpconnector.opentext.com/1.0/implementation"xmlns:c="http://schemas.cordys.com/cws/1.0"xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"type="HTTP">
<connection-id>CORE-DDRI</connection-id>
<uri>/v1/auth/login</uri>
<http-method>POST</http-method>
<request-handlerclass="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler"/>
<req-headers>
<headername="Content-Type">application/json</header>
<headername="Accept">*/*</header>
</req-headers>
<request>
<body>
<![CDATA[
{
"tenantId": "tenant",
"user": "user",
"password": "password!"
}
]]>
</body>
</request>
<response-handlerclass="com.opentext.applicationconnector.httpconnector.impl.RestResponseHandler"/>
<valid-response-code>200</valid-response-code>
<namespaces />
</implementation>
The problem is when I try to invoke to test the web service operation, I am getting a 415 response which means unsupported media type. I am sure that the login endpoint accepts json since I can call it using postman, but it doesn’t work in process automation. Please help.