Subversion Repositories XServices

Rev

Rev 201 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 201 Rev 203
Line 20... Line 20...
20
import org.apache.http.HttpEntity;
20
import org.apache.http.HttpEntity;
21
import org.apache.http.client.ClientProtocolException;
21
import org.apache.http.client.ClientProtocolException;
22
import org.apache.http.client.entity.EntityBuilder;
22
import org.apache.http.client.entity.EntityBuilder;
23
import org.apache.http.client.fluent.Request;
23
import org.apache.http.client.fluent.Request;
24
import org.apache.http.client.fluent.Response;
24
import org.apache.http.client.fluent.Response;
-
 
25
import org.apache.http.entity.ContentType;
Line 25... Line 26...
25
 
26
 
26
import java.io.BufferedReader;
27
import java.io.BufferedReader;
27
import java.io.IOException;
28
import java.io.IOException;
28
import java.io.InputStreamReader;
29
import java.io.InputStreamReader;
-
 
30
import java.io.Reader;
-
 
31
import java.nio.charset.Charset;
29
import java.io.Reader;
32
import java.nio.charset.StandardCharsets;
Line 30... Line 33...
30
import java.util.concurrent.atomic.AtomicBoolean;
33
import java.util.concurrent.atomic.AtomicBoolean;
31
 
34
 
Line 67... Line 70...
67
		 * @throws IOException             Signals that an I/O exception has occurred.
70
		 * @throws IOException             Signals that an I/O exception has occurred.
68
		 */
71
		 */
69
		public Reader sendSoap(boolean isDropResponse) {
72
		public Reader sendSoap(boolean isDropResponse) {
70
			Reader response = null;
73
			Reader response = null;
71
			long start = System.currentTimeMillis();
74
			long start = System.currentTimeMillis();
-
 
75
 
72
			EntityBuilder entitybuilder = EntityBuilder.create();
76
			HttpEntity entity = EntityBuilder.create()
-
 
77
					.setText(soapBody)
73
			entitybuilder.setContentEncoding("UTF-8");
78
					.setContentType(ContentType.create("text/xml", StandardCharsets.UTF_8))
74
			entitybuilder.setText(soapBody);
79
					.setContentEncoding("UTF-8")
75
			HttpEntity entity = entitybuilder.build();
80
					.build();
Line 76... Line 81...
76
 
81
 
Line 77... Line 82...
77
			log.trace("Sending event '{}' to target ALF Event Manager.", id);
82
			log.trace("Sending event '{}' to target ALF Event Manager.", id);
Line 78... Line 83...
78
 
83
 
79
			if(isInterrupted.get()) return null;
84
			if(isInterrupted.get()) return null;
80
 
85
 
81
			try {
86
			try {
82
				Response resp = Request.Post(url)
87
				Response resp = Request.Post(url)
83
						.addHeader("Accept", "text/xml")
88
						.addHeader("Accept", "text/xml")
Line 84... Line 89...
84
						.addHeader("Content-Type", "text/xml; charset=utf-8")
89
						//.addHeader("Content-Type", "text/xml; charset=utf-8")
85
						.addHeader("SOAPAction", "")
90
						.addHeader("SOAPAction", "")