protected String makeSoapCall ( String soapMessageString , HpsmSoapModel hpsmSoapModel ) throws HygieiaException { String requestAction = hpsmSoapModel . getSoapAction ( ) ; String response = "" ; contentType = hpsmSettings . getContentType ( ) ; charset = hpsmSettings . getCharset ( ) ; try { startHttpConnection ( ) ; RequestEntity entity = new StringRequestEntity ( soapMessageString , contentType , charset ) ; post . setRequestEntity ( entity ) ; post . setRequestHeader ( "SOAPAction" , requestAction ) ; httpclient . executeMethod ( post ) ; response = getResponseString ( post . getResponseBodyAsStream ( ) ) ; if ( ! "OK" . equals ( post . getStatusText ( ) ) ) { throw new HygieiaException ( "Soap Request Failure: " + post . getStatusCode ( ) + "|response: " + response , HygieiaException . BAD_DATA ) ; } stopHttpConnection ( ) ; } catch ( IOException e ) { LOG . error ( "Error while trying to make soap call: " + e ) ; } return response ; }
Makes SOAP request for given soap message