return;
}
}
}
OutputBuffer outbuffer = new OutputBuffer();
msgContext.setProperty(MessageContext.TRANSPORT_OUT, outbuffer);
msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, outbuffer);
// deal with GET request
boolean processed = HTTPTransportUtils.processHTTPGetRequest(
msgContext,
outbuffer.getOutputStream(),
soapAction,
uri,
configurationContext,
HTTPTransportReceiver.getGetRequestParameters(uri));
if (processed) {
outbuffer.setChunked(chunked);
response.setEntity(outbuffer);
} else {
response.setStatusLine(new StatusLine(ver, 200, "OK"));
String s = HTTPTransportReceiver.getServicesHTML(configurationContext);
StringEntity entity = new StringEntity(s);
entity.setContentType("text/html");
entity.setChunked(chunked);
response.setEntity(entity);
}
} else if (method.equals(HTTPConstants.HEADER_POST)) {
// deal with POST request
OutputBuffer outbuffer = new OutputBuffer();
msgContext.setProperty(MessageContext.TRANSPORT_OUT, outbuffer);
msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, outbuffer);
HttpEntity inentity = ((HttpEntityEnclosingRequest) request).getEntity();
String contenttype = null;
if (inentity.getContentType() != null) {
contenttype = inentity.getContentType().getValue();
}
HTTPTransportUtils.processHTTPPostRequest(
msgContext,
inentity.getContent(),
outbuffer.getOutputStream(),
contenttype,
soapAction,
uri);
outbuffer.setChunked(chunked);
response.setEntity(outbuffer);
} else {
throw new MethodNotSupportedException(method + " method not supported");
}