Hi, this is in relation to
Calling External REST API - OpenText - Forums
So i can call external REST APIs now and im trying to call a REST API from content-server.
Below is my web service implementation for the auth endpoint.
<implementation xmlns="http://httpconnector.opentext.com/1.0/implementation" xmlns:cws="http://schemas.cordys.com/cws/1.0" xmlns:c="http://schemas.cordys.com/cws/1.0" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" type="HTTP">
<connection-id>CONTENT-SERVER</connection-id>
<uri>/v1/auth</uri>
<http-method>POST</http-method>
<request-handler class="com.opentext.applicationconnector.httpconnector.impl.RestRequestHandler">
<req-headers>
<header name="Content-Type">application/x-www-form-urlencoded</header>
<header name="Content-Length"></header>
<header name="Host"></header>
</req-headers>
</request-handler>
<response-handler class="com.opentext.applicationconnector.httpconnector.impl.RestResponseHandler">
</response-handler>
<valid-response-code>200</valid-response-code>
</implementation>
I included the Content-Length and Host header since i noticed these two are needed in postman.
my soap request looks like this
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
SOAP:Body
<AuthenticateUser xmlns="ce">
<username>"username"</username>
<password>"password"</password>
</AuthenticateUser>
</SOAP:Body>
</SOAP:Envelope>
however, i am getting a response of 400 which means the connection is valid, it's just that the request is not correct at some parts. In postman i noticed that if i uncheck the Host header, it also return 400, that's why i thought adding it in the implementation would fix the problem but it does not. Next i am thinking is that the format for the soap request for content type application/x-www-form-urlencoded is different. I would appreciate any insights for this. Thanks!