I’m trying to send a http request from PLSQL. It works fine.
HttpRequest := UTL_HTTP.BEGIN_REQUEST (url => v_http_url, METHOD => 'POST');
utl_http.set_header(HttpRequest, 'Content-Type', 'text/xml; charset=utf-8' );
utl_http.set_header(HttpRequest, 'Content-Length', 64);
utl_http.write_line(HttpRequest, 'some string');
Httpresp := utl_http.get_response(HttpRequest);
utl_http.end_request(HttpRequest);
utl_http.end_response(Httpresp);
The Spring Integration side:
<int:channel id="inputChannel" />
<int:channel id="outputChannel" />
<int-http:inbound-gateway request-channel="inputChannel"
reply-channel="outputChannel" supported-methods="POST" name="/req"
message-converters="MyRequestConverter"
request-payload-type="MyRequest">
</int-http:inbound-gateway>
<int:service-activator input-channel="inputChannel"
method="getMessage" ref="dbmock"></int:service-activator>
I’ve created MyRequestConverter with methods:
MyRequest readInternal(Class<? extends MyRequest > _class, HttpInputMessage message) throws IOException
void writeInternal(MyRequest request, HttpOutputMessage message)
My service method looks like this:
public Object getMessage(@Headers Map<String, Object> headers, @Payload MyRequest payload)
The problem is PLSQL site doesn’t get response – it waits endlessly. When I comment
Httpresp := utl_http.get_response(HttpRequest)
PLSQL procedure is executed succesfully. Moreover I get exception that there’s no converter for java.lang.String.
Is there any way to use MyRequestConverter in reversed direction?
Thanks for any help!
You are setting the content-length to 64, but only sending 11 bytes. The server is waiting for more data.