Subversion Repositories XServices

Rev

Rev 150 | Rev 201 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 196
Line 13... Line 13...
13
 *   See the License for the specific language governing permissions and
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
16
package net.brutex.emitter;
16
package net.brutex.emitter;
Line 17... Line -...
17
 
-
 
18
import java.io.BufferedReader;
-
 
19
import java.io.IOException;
-
 
20
import java.io.InputStreamReader;
-
 
21
 
17
 
22
import org.apache.http.HttpEntity;
18
import org.apache.http.HttpEntity;
23
import org.apache.http.HttpResponse;
19
import org.apache.http.HttpResponse;
24
import org.apache.http.client.ClientProtocolException;
20
import org.apache.http.client.ClientProtocolException;
25
import org.apache.http.client.entity.EntityBuilder;
21
import org.apache.http.client.entity.EntityBuilder;
26
import org.apache.http.client.methods.HttpPost;
22
import org.apache.http.client.methods.HttpPost;
27
import org.apache.http.impl.client.CloseableHttpClient;
23
import org.apache.http.impl.client.CloseableHttpClient;
28
import org.apache.http.impl.client.HttpClients;
-
 
29
import org.apache.http.util.EntityUtils;
24
import org.apache.http.impl.client.HttpClients;
Line -... Line 25...
-
 
25
import org.apache.log4j.Logger;
-
 
26
 
-
 
27
import java.io.BufferedReader;
-
 
28
import java.io.IOException;
30
import org.apache.log4j.Logger;
29
import java.io.InputStreamReader;
31
 
30
 
32
/**
31
/**
33
 * Construct a HTTP POST and send it.
32
 * Construct a HTTP POST and send it.
34
 *
33
 *
Line 54... Line 53...
54
	}
53
	}
Line 55... Line 54...
55
	
54
 
56
	/**
55
	/**
57
	 * Send soap.
56
	 * Send soap.
58
	 *
-
 
59
	 * @param url the url
57
	 *
60
	 * @param soapBody the soap body
58
	 * @param isDropResponse show interest in response or not
61
	 * @throws ClientProtocolException the client protocol exception
59
	 * @throws ClientProtocolException the client protocol exception
62
	 * @throws IOException Signals that an I/O exception has occurred.
60
	 * @throws IOException             Signals that an I/O exception has occurred.
63
	 */
61
	 */
64
	public void sendSoap(boolean isDropResponse) throws ClientProtocolException, IOException {
62
	public void sendSoap(boolean isDropResponse) throws ClientProtocolException, IOException {
65
		long start = System.currentTimeMillis();
63
		long start = System.currentTimeMillis();
66
		HttpPost post = new HttpPost(url);
64
		HttpPost post = new HttpPost(url);
-
 
65
		post.addHeader("Accept", "text/xml");
67
        post.addHeader("Accept" , "text/xml");
66
		post.addHeader("Content-Type", "text/xml; charset=utf-8");
68
        post.addHeader("SOAPAction","");
67
		post.addHeader("SOAPAction", "");
69
        EntityBuilder entitybuilder = EntityBuilder.create();
68
		EntityBuilder entitybuilder = EntityBuilder.create();
70
        entitybuilder.setContentEncoding("UTF-8");
69
		entitybuilder.setContentEncoding("UTF-8");
71
        entitybuilder.setText(soapBody);
70
		entitybuilder.setText(soapBody);