public SOAPMessage sendRequestAndReceiveResponse(String address,String contentType,InputStream content) throws Exception {
  try (AsyncHttpSender sender=new AsyncHttpSender(client)){
    sender.doPost(new URI(address),content,CHUNKED_LENGTH,contentType);
    sender.waitForResponse(getTimeoutSec());
    String responseContentType=sender.getResponseContentType();
    MimeHeaders mimeHeaders=getMimeHeaders(responseContentType);
    LOG.debug("Received response with content type {}",responseContentType);
    return messageFactory.createMessage(mimeHeaders,sender.getResponseContent());
  }
 }

public SOAPMessage sendRequestAndReceiveResponse ( String address , String contentType , InputStream content ) throws Exception { try ( AsyncHttpSender sender = new AsyncHttpSender ( client ) ) { sender . doPost ( new URI ( address ) , content , CHUNKED_LENGTH , contentType ) ; sender . waitForResponse ( getTimeoutSec ( ) ) ; String responseContentType = sender . getResponseContentType ( ) ; MimeHeaders mimeHeaders = getMimeHeaders ( responseContentType ) ; LOG . debug ( "Received response with content type {}" , responseContentType ) ; return messageFactory . createMessage ( mimeHeaders , sender . getResponseContent ( ) ) ; } }
seconds the request in the given input stream to the specified address and returns a response .
