You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2007/02/25 20:57:05 UTC
svn commit: r511585 [6/10] - in /webservices/axis2/trunk/java/modules/kernel:
src/org/apache/axis2/addressing/ src/org/apache/axis2/addressing/wsdl/
src/org/apache/axis2/builder/ src/org/apache/axis2/cluster/
src/org/apache/axis2/context/ src/org/apach...
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/MessageFormatter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/MessageFormatter.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/MessageFormatter.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/MessageFormatter.java Sun Feb 25 11:56:59 2007
@@ -33,55 +33,55 @@
* </p>
* <p>
* <messageFormatters>
- * <messageFormatter contentType="application/soap+xml"
- * class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+ * <messageFormatter contentType="application/soap+xml"
+ * class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
* </messageFormatters>
* </p>
*/
public interface MessageFormatter {
-
- /**
- * @return a byte array of the message formatted according to the given
- * message format.
- */
- public byte[] getBytes(MessageContext messageContext, OMOutputFormat format)
- throws AxisFault;
+
+ /**
+ * @return a byte array of the message formatted according to the given
+ * message format.
+ */
+ public byte[] getBytes(MessageContext messageContext, OMOutputFormat format)
+ throws AxisFault;
- /**
- * To support deffered writing transports as in http chunking.. Axis2 was
- * doing this for some time..
- *
- * Preserve flag can be used to preserve the envelope for later use. This is
- * usefull when implementing authentication machnisms like NTLM.
- *
- * @param outputStream
- * @param preserve :
- * do not consume the OM when this is set..
- */
- public void writeTo(MessageContext messageContext, OMOutputFormat format,
- OutputStream outputStream, boolean preserve) throws AxisFault;
+ /**
+ * To support deffered writing transports as in http chunking.. Axis2 was
+ * doing this for some time..
+ *
+ * Preserve flag can be used to preserve the envelope for later use. This is
+ * usefull when implementing authentication machnisms like NTLM.
+ *
+ * @param outputStream
+ * @param preserve :
+ * do not consume the OM when this is set..
+ */
+ public void writeTo(MessageContext messageContext, OMOutputFormat format,
+ OutputStream outputStream, boolean preserve) throws AxisFault;
- /**
- * Different message formats can set their own content types
- * Eg: JSONFormatter can set the content type as application/json
- * @param messageContext
- * @param format
- * @param soapAction
- */
- public String getContentType(MessageContext messageContext, OMOutputFormat format,
- String soapAction);
+ /**
+ * Different message formats can set their own content types
+ * Eg: JSONFormatter can set the content type as application/json
+ * @param messageContext
+ * @param format
+ * @param soapAction
+ */
+ public String getContentType(MessageContext messageContext, OMOutputFormat format,
+ String soapAction);
- /**
- * Some message formats may want to alter the target url.
- *
- * @return the target URL
- */
- public URL getTargetAddress(MessageContext messageContext, OMOutputFormat format,
- URL targetURL) throws AxisFault;
+ /**
+ * Some message formats may want to alter the target url.
+ *
+ * @return the target URL
+ */
+ public URL getTargetAddress(MessageContext messageContext, OMOutputFormat format,
+ URL targetURL) throws AxisFault;
- /**
- * @return this only if you want set a transport header for SOAP Action
- */
- public String formatSOAPAction(MessageContext messageContext, OMOutputFormat format,
- String soapAction);
+ /**
+ * @return this only if you want set a transport header for SOAP Action
+ */
+ public String formatSOAPAction(MessageContext messageContext, OMOutputFormat format,
+ String soapAction);
}
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/MessageFormatter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java Sun Feb 25 11:56:59 2007
@@ -30,7 +30,7 @@
*/
public interface RequestResponseTransport
{
-
+
/*This is the name of the property that is to be stored on the
MessageContext*/
public static final String TRANSPORT_CONTROL
@@ -78,27 +78,27 @@
* Used to give the current status of the RequestResponseTransport object.
*/
public class RequestResponseTransportStatus {
- /**
- * Transport is in its initial stage.
- */
- public static RequestResponseTransportStatus INITIAL = new RequestResponseTransportStatus (1);
-
- /**
- * awaitResponse has been called.
- */
- public static RequestResponseTransportStatus WAITING = new RequestResponseTransportStatus (2);
-
- /**
- * 'signalResponseReady' has been called.
- */
- public static RequestResponseTransportStatus SIGNALLED = new RequestResponseTransportStatus (3);
-
- private int value;
-
- private RequestResponseTransportStatus (int value) {
- this.value = value;
- }
-
+ /**
+ * Transport is in its initial stage.
+ */
+ public static RequestResponseTransportStatus INITIAL = new RequestResponseTransportStatus (1);
+
+ /**
+ * awaitResponse has been called.
+ */
+ public static RequestResponseTransportStatus WAITING = new RequestResponseTransportStatus (2);
+
+ /**
+ * 'signalResponseReady' has been called.
+ */
+ public static RequestResponseTransportStatus SIGNALLED = new RequestResponseTransportStatus (3);
+
+ private int value;
+
+ private RequestResponseTransportStatus (int value) {
+ this.value = value;
+ }
+
public int hashCode()
{
return value;
@@ -111,9 +111,9 @@
final RequestResponseTransportStatus instance = (RequestResponseTransportStatus)obj;
return (value==instance.value);
}
-
+
public String toString() {
- return Integer.toString(value);
+ return Integer.toString(value);
}
}
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/SimpleAxis2Server.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/SimpleAxis2Server.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/SimpleAxis2Server.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/SimpleAxis2Server.java Sun Feb 25 11:56:59 2007
@@ -44,53 +44,53 @@
* @throws Exception
*/
public static void main(String[] args) throws Exception {
- String repoLocation = null;
- String confLocation = null;
+ String repoLocation = null;
+ String confLocation = null;
- CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
- List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
- public boolean isInvalid(CommandLineOption option) {
- String optionType = option.getOptionType();
- return !("repo".equalsIgnoreCase(optionType) || "conf"
- .equalsIgnoreCase(optionType));
- }
- });
-
- if ((invalidOptionsList.size()>0)||(args.length>4))
- {
- printUsage();
- return;
- }
-
- Map optionsMap = optionsParser.getAllOptions();
+ CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
+ List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
+ public boolean isInvalid(CommandLineOption option) {
+ String optionType = option.getOptionType();
+ return !("repo".equalsIgnoreCase(optionType) || "conf"
+ .equalsIgnoreCase(optionType));
+ }
+ });
+
+ if ((invalidOptionsList.size()>0)||(args.length>4))
+ {
+ printUsage();
+ return;
+ }
+
+ Map optionsMap = optionsParser.getAllOptions();
- CommandLineOption repoOption = (CommandLineOption) optionsMap
- .get("repo");
- CommandLineOption confOption = (CommandLineOption) optionsMap
- .get("conf");
+ CommandLineOption repoOption = (CommandLineOption) optionsMap
+ .get("repo");
+ CommandLineOption confOption = (CommandLineOption) optionsMap
+ .get("conf");
- log.info("[SimpleAxisServer] Starting");
- if (repoOption != null) {
- repoLocation = repoOption.getOptionValue();
- log.info("[SimpleAxisServer] Using the Axis2 Repository"
- + new File(repoLocation).getAbsolutePath());
- }
- if (confOption != null) {
- confLocation = confOption.getOptionValue();
- System.out
- .println("[SimpleAxisServer] Using the Axis2 Configuration File"
- + new File(confLocation).getAbsolutePath());
- }
-
- try {
- ConfigurationContext configctx = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(repoLocation,
- confLocation);
- ListenerManager listenerManager = new ListenerManager();
- listenerManager.init(configctx);
- listenerManager.start();
- log.info("[SimpleAxisServer] Started");
- } catch (Throwable t) {
+ log.info("[SimpleAxisServer] Starting");
+ if (repoOption != null) {
+ repoLocation = repoOption.getOptionValue();
+ log.info("[SimpleAxisServer] Using the Axis2 Repository"
+ + new File(repoLocation).getAbsolutePath());
+ }
+ if (confOption != null) {
+ confLocation = confOption.getOptionValue();
+ System.out
+ .println("[SimpleAxisServer] Using the Axis2 Configuration File"
+ + new File(confLocation).getAbsolutePath());
+ }
+
+ try {
+ ConfigurationContext configctx = ConfigurationContextFactory
+ .createConfigurationContextFromFileSystem(repoLocation,
+ confLocation);
+ ListenerManager listenerManager = new ListenerManager();
+ listenerManager.init(configctx);
+ listenerManager.start();
+ log.info("[SimpleAxisServer] Started");
+ } catch (Throwable t) {
log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java Sun Feb 25 11:56:59 2007
@@ -51,124 +51,124 @@
private static final Log log = LogFactory.getLog(TransportUtils.class);
public static SOAPEnvelope createSOAPMessage(MessageContext msgContext) throws AxisFault {
- try {
- InputStream inStream = (InputStream) msgContext
- .getProperty(MessageContext.TRANSPORT_IN);
-
- msgContext.setProperty(MessageContext.TRANSPORT_IN, null);
-
- // this inputstram is set by the TransportSender represents a two
- // way transport or by a Transport Recevier
- if (inStream == null) {
- throw new AxisFault(Messages.getMessage("inputstreamNull"));
- }
- Object contentTypeObject;
- boolean isMIME = false;
-
- contentTypeObject = msgContext.getProperty(HTTPConstants.CONTENT_TYPE);
-
- String contentType=null;
- if(contentTypeObject!=null){
- contentType =(String) contentTypeObject;
- if (JavaUtils.indexOfIgnoreCase(contentType,
- HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) > -1) {
- isMIME = true;
- }
- }
+ try {
+ InputStream inStream = (InputStream) msgContext
+ .getProperty(MessageContext.TRANSPORT_IN);
+
+ msgContext.setProperty(MessageContext.TRANSPORT_IN, null);
+
+ // this inputstram is set by the TransportSender represents a two
+ // way transport or by a Transport Recevier
+ if (inStream == null) {
+ throw new AxisFault(Messages.getMessage("inputstreamNull"));
+ }
+ Object contentTypeObject;
+ boolean isMIME = false;
+
+ contentTypeObject = msgContext.getProperty(HTTPConstants.CONTENT_TYPE);
+
+ String contentType=null;
+ if(contentTypeObject!=null){
+ contentType =(String) contentTypeObject;
+ if (JavaUtils.indexOfIgnoreCase(contentType,
+ HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) > -1) {
+ isMIME = true;
+ }
+ }
String soapNamespaceURI = getSOAPNamespaceFromContentType(contentType, null);
- String charSetEnc = (String) msgContext
- .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
- if (charSetEnc == null) {
- charSetEnc = (String) msgContext
- .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
- }
- if (charSetEnc == null) {
- charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING;
- }
- return createSOAPMessage(msgContext, inStream, soapNamespaceURI,
- isMIME, contentType, charSetEnc);
- } catch (AxisFault e) {
- throw e;
- } catch (OMException e) {
- throw new AxisFault(e);
- } catch (XMLStreamException e) {
- throw new AxisFault(e);
- } catch (FactoryConfigurationError e) {
- throw new AxisFault(e);
- }
- }
+ String charSetEnc = (String) msgContext
+ .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
+ if (charSetEnc == null) {
+ charSetEnc = (String) msgContext
+ .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
+ }
+ if (charSetEnc == null) {
+ charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING;
+ }
+ return createSOAPMessage(msgContext, inStream, soapNamespaceURI,
+ isMIME, contentType, charSetEnc);
+ } catch (AxisFault e) {
+ throw e;
+ } catch (OMException e) {
+ throw new AxisFault(e);
+ } catch (XMLStreamException e) {
+ throw new AxisFault(e);
+ } catch (FactoryConfigurationError e) {
+ throw new AxisFault(e);
+ }
+ }
/**
- * Objective of this method is to capture the SOAPEnvelope creation logic
- * and make it a common for all the transports and to in/out flows.
- *
- * @param msgContext
- * @param inStream
- * @param soapNamespaceURI
- * @param isMIME
- * @param contentType
- * @param charSetEnc
- * @return the SOAPEnvelope
- * @throws AxisFault
- * @throws OMException
- * @throws XMLStreamException
- * @throws FactoryConfigurationError
- */
+ * Objective of this method is to capture the SOAPEnvelope creation logic
+ * and make it a common for all the transports and to in/out flows.
+ *
+ * @param msgContext
+ * @param inStream
+ * @param soapNamespaceURI
+ * @param isMIME
+ * @param contentType
+ * @param charSetEnc
+ * @return the SOAPEnvelope
+ * @throws AxisFault
+ * @throws OMException
+ * @throws XMLStreamException
+ * @throws FactoryConfigurationError
+ */
public static SOAPEnvelope createSOAPMessage(MessageContext msgContext,
- InputStream inStream, String soapNamespaceURI, boolean isMIME,
- String contentType, String charSetEnc) throws AxisFault,
- OMException, XMLStreamException, FactoryConfigurationError {
- OMElement documentElement=null;
- String charsetEncoding=null;
- if (isMIME) {
- StAXBuilder builder = Builder.getAttachmentsBuilder(
- msgContext, inStream, contentType, !(msgContext
- .isDoingREST()));
- documentElement = builder.getDocumentElement();
- charsetEncoding = builder.getDocument().getCharsetEncoding();
- } else if (msgContext.isDoingREST()) {
- StAXBuilder builder = Builder.getPOXBuilder(inStream,
- charSetEnc, soapNamespaceURI);
- documentElement = builder.getDocumentElement();
- charsetEncoding = builder.getDocument().getCharsetEncoding();
-// } else if (soapNamespaceURI!=null){
-// builder = Builder.getBuilder(inStream, charSetEnc,soapNamespaceURI);
- }else if (contentType!=null)
- {
- OMBuilder builder = Builder.getBuilderFromSelector(contentType, msgContext);
- if (builder != null) {
- documentElement = builder.processDocument(inStream, msgContext);
-// charsetEncoding = builder.getCharsetEncoding();
- }
- }
- if (documentElement==null)
- {
- //FIXME making soap defualt for the moment..might effect the performance
- StAXBuilder builder = Builder.getSOAPBuilder(inStream, charSetEnc,soapNamespaceURI);
- documentElement = builder.getDocumentElement();
- charsetEncoding = builder.getDocument().getCharsetEncoding();
-// throw new AxisFault("Cannot find a matching builder for the message. Unsupported Content Type.");
- }
-
- SOAPEnvelope envelope;
- //Check whether we have received a SOAPEnvelope or not
- if (documentElement instanceof SOAPEnvelope) {
- envelope = (SOAPEnvelope) documentElement;
- } else {
- //If it is not a SOAPEnvelope we wrap that with a fake SOAPEnvelope.
- SOAPFactory soapFactory = new SOAP11Factory();
- envelope= soapFactory.getDefaultEnvelope();
- envelope.getBody().addChild(documentElement);
- }
-
- /* if ((charsetEncoding != null)
- && !"".equals(charsetEncoding)
- && (msgContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING) != null)
- && !charsetEncoding.equalsIgnoreCase((String) msgContext
- .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING))) {
- String faultCode;
+ InputStream inStream, String soapNamespaceURI, boolean isMIME,
+ String contentType, String charSetEnc) throws AxisFault,
+ OMException, XMLStreamException, FactoryConfigurationError {
+ OMElement documentElement=null;
+ String charsetEncoding=null;
+ if (isMIME) {
+ StAXBuilder builder = Builder.getAttachmentsBuilder(
+ msgContext, inStream, contentType, !(msgContext
+ .isDoingREST()));
+ documentElement = builder.getDocumentElement();
+ charsetEncoding = builder.getDocument().getCharsetEncoding();
+ } else if (msgContext.isDoingREST()) {
+ StAXBuilder builder = Builder.getPOXBuilder(inStream,
+ charSetEnc, soapNamespaceURI);
+ documentElement = builder.getDocumentElement();
+ charsetEncoding = builder.getDocument().getCharsetEncoding();
+// } else if (soapNamespaceURI!=null){
+// builder = Builder.getBuilder(inStream, charSetEnc,soapNamespaceURI);
+ }else if (contentType!=null)
+ {
+ OMBuilder builder = Builder.getBuilderFromSelector(contentType, msgContext);
+ if (builder != null) {
+ documentElement = builder.processDocument(inStream, msgContext);
+// charsetEncoding = builder.getCharsetEncoding();
+ }
+ }
+ if (documentElement==null)
+ {
+ //FIXME making soap defualt for the moment..might effect the performance
+ StAXBuilder builder = Builder.getSOAPBuilder(inStream, charSetEnc,soapNamespaceURI);
+ documentElement = builder.getDocumentElement();
+ charsetEncoding = builder.getDocument().getCharsetEncoding();
+// throw new AxisFault("Cannot find a matching builder for the message. Unsupported Content Type.");
+ }
+
+ SOAPEnvelope envelope;
+ //Check whether we have received a SOAPEnvelope or not
+ if (documentElement instanceof SOAPEnvelope) {
+ envelope = (SOAPEnvelope) documentElement;
+ } else {
+ //If it is not a SOAPEnvelope we wrap that with a fake SOAPEnvelope.
+ SOAPFactory soapFactory = new SOAP11Factory();
+ envelope= soapFactory.getDefaultEnvelope();
+ envelope.getBody().addChild(documentElement);
+ }
+
+ /* if ((charsetEncoding != null)
+ && !"".equals(charsetEncoding)
+ && (msgContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING) != null)
+ && !charsetEncoding.equalsIgnoreCase((String) msgContext
+ .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING))) {
+ String faultCode;
if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(
envelope.getNamespace().getNamespaceURI())) {
@@ -181,8 +181,8 @@
"Character Set Encoding from " + "transport information do not match with "
+ "character set encoding in the received SOAP message", faultCode);
}*/
- return envelope;
- }
+ return envelope;
+ }
/**
* Extracts and returns the character set encoding from the
@@ -258,14 +258,14 @@
* @throws AxisFault
*/
public static MessageFormatter getMessageFormatter(MessageContext msgContext)
- throws AxisFault {
- MessageFormatter messageFormatter = null;
- String messageFormatString = getMessageFormatterProperty(msgContext);
- if (messageFormatString != null) {
- messageFormatter = msgContext.getConfigurationContext()
- .getAxisConfiguration().getMessageFormatter(messageFormatString);
-
- }
+ throws AxisFault {
+ MessageFormatter messageFormatter = null;
+ String messageFormatString = getMessageFormatterProperty(msgContext);
+ if (messageFormatString != null) {
+ messageFormatter = msgContext.getConfigurationContext()
+ .getAxisConfiguration().getMessageFormatter(messageFormatString);
+
+ }
if (messageFormatter == null) {
// If we are doing rest better default to Application/xml formatter
@@ -278,7 +278,7 @@
}
}
return messageFormatter;
- }
+ }
/**
@@ -337,19 +337,19 @@
private static String getMessageFormatterProperty(MessageContext msgContext) {
- String messageFormatterProperty = null;
- Object property = msgContext
- .getProperty(Constants.Configuration.MESSAGE_TYPE);
- if (property != null) {
- messageFormatterProperty = (String) property;
- }
- if (messageFormatterProperty == null) {
- Parameter parameter = msgContext
- .getParameter(Constants.Configuration.MESSAGE_TYPE);
- if (parameter != null) {
- messageFormatterProperty = (String) parameter.getValue();
- }
- }
- return messageFormatterProperty;
+ String messageFormatterProperty = null;
+ Object property = msgContext
+ .getProperty(Constants.Configuration.MESSAGE_TYPE);
+ if (property != null) {
+ messageFormatterProperty = (String) property;
+ }
+ if (messageFormatterProperty == null) {
+ Parameter parameter = msgContext
+ .getParameter(Constants.Configuration.MESSAGE_TYPE);
+ if (parameter != null) {
+ messageFormatterProperty = (String) parameter.getValue();
+ }
+ }
+ return messageFormatterProperty;
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractAgent.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractAgent.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractAgent.java Sun Feb 25 11:56:59 2007
@@ -42,7 +42,7 @@
protected static final String DEFAULT_INDEX_JSP = "index.jsp";
private static final String METHOD_PREFIX = "process";
- private static final Log log = LogFactory.getLog(AbstractAgent.class);
+ private static final Log log = LogFactory.getLog(AbstractAgent.class);
protected transient Map operationCache = new HashMap();
protected transient ConfigurationContext configContext;
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Sun Feb 25 11:56:59 2007
@@ -211,27 +211,27 @@
*/
protected void obtainHTTPHeaderInformation(HttpMethodBase method,
MessageContext msgContext) {
- Map transportHeaders = new CommonsTransportHeaders(method.getResponseHeaders());
- msgContext.setProperty(MessageContext.TRANSPORT_HEADERS,transportHeaders);
+ Map transportHeaders = new CommonsTransportHeaders(method.getResponseHeaders());
+ msgContext.setProperty(MessageContext.TRANSPORT_HEADERS,transportHeaders);
Header header =method.getResponseHeader(HTTPConstants.HEADER_CONTENT_TYPE);
if (header != null) {
- HeaderElement[] headers = header.getElements();
- OperationContext opContext = msgContext.getOperationContext();
-
- if (opContext != null) {
- opContext.setProperty(
- HTTPConstants.CONTENT_TYPE,header.getValue());
+ HeaderElement[] headers = header.getElements();
+ OperationContext opContext = msgContext.getOperationContext();
+
+ if (opContext != null) {
+ opContext.setProperty(
+ HTTPConstants.CONTENT_TYPE,header.getValue());
- for (int i = 0; i < headers.length; i++) {
- NameValuePair charsetEnc =headers[i].getParameterByName(
- HTTPConstants.CHAR_SET_ENCODING);
- if (charsetEnc != null) {
- opContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,
- charsetEnc.getValue()); // change to the value, which is text/xml or application/xml+soap
- }
- }
- }
+ for (int i = 0; i < headers.length; i++) {
+ NameValuePair charsetEnc =headers[i].getParameterByName(
+ HTTPConstants.CHAR_SET_ENCODING);
+ if (charsetEnc != null) {
+ opContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,
+ charsetEnc.getValue()); // change to the value, which is text/xml or application/xml+soap
+ }
+ }
+ }
}
String sessionCookie = null;
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java Sun Feb 25 11:56:59 2007
@@ -118,63 +118,63 @@
protected void processUpload(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
- String hasHotDeployment =
- (String) configContext.getAxisConfiguration().getParameterValue("hotdeployment");
- String hasHotUpdate =
- (String) configContext.getAxisConfiguration().getParameterValue("hotupdate");
- req.setAttribute("hotDeployment", (hasHotDeployment.equals("true")) ? "enabled"
- : "disabled");
- req.setAttribute("hotUpdate", (hasHotUpdate.equals("true")) ? "enabled" : "disabled");
+ String hasHotDeployment =
+ (String) configContext.getAxisConfiguration().getParameterValue("hotdeployment");
+ String hasHotUpdate =
+ (String) configContext.getAxisConfiguration().getParameterValue("hotupdate");
+ req.setAttribute("hotDeployment", (hasHotDeployment.equals("true")) ? "enabled"
+ : "disabled");
+ req.setAttribute("hotUpdate", (hasHotUpdate.equals("true")) ? "enabled" : "disabled");
RequestContext reqContext = new ServletRequestContext(req);
- boolean isMultipart = ServletFileUpload.isMultipartContent(reqContext);
+ boolean isMultipart = ServletFileUpload.isMultipartContent(reqContext);
if (isMultipart) {
- try {
- //Create a factory for disk-based file items
- FileItemFactory factory = new DiskFileItemFactory();
- //Create a new file upload handler
- ServletFileUpload upload = new ServletFileUpload(factory);
- List items = upload.parseRequest(req);
- // Process the uploaded items
- Iterator iter = items.iterator();
- while (iter.hasNext()) {
- FileItem item = (FileItem) iter.next();
- if (!item.isFormField()) {
-
- String fileName = item.getName();
- String fileExtesion = fileName;
- fileExtesion = fileExtesion.toLowerCase();
- if (!(fileExtesion.endsWith(".jar") || fileExtesion.endsWith(".aar"))) {
- req.setAttribute("status", "failure");
- req.setAttribute("cause", "Unsupported file type " + fileExtesion);
- } else {
-
- String fileNameOnly ;
- if (fileName.indexOf("\\") < 0) {
- fileNameOnly =
- fileName.substring(fileName.lastIndexOf("/") + 1, fileName
- .length());
- } else {
- fileNameOnly =
- fileName.substring(fileName.lastIndexOf("\\") + 1, fileName
- .length());
- }
-
- File uploadedFile = new File(serviceDir, fileNameOnly);
- item.write(uploadedFile);
- req.setAttribute("status", "success");
- req.setAttribute("filename", fileNameOnly);
- }
- }
- }
- } catch (Exception e) {
- req.setAttribute("status", "failure");
- req.setAttribute("cause", e.getMessage());
-
- }
- }
- renderView("upload.jsp", req, res);
+ try {
+ //Create a factory for disk-based file items
+ FileItemFactory factory = new DiskFileItemFactory();
+ //Create a new file upload handler
+ ServletFileUpload upload = new ServletFileUpload(factory);
+ List items = upload.parseRequest(req);
+ // Process the uploaded items
+ Iterator iter = items.iterator();
+ while (iter.hasNext()) {
+ FileItem item = (FileItem) iter.next();
+ if (!item.isFormField()) {
+
+ String fileName = item.getName();
+ String fileExtesion = fileName;
+ fileExtesion = fileExtesion.toLowerCase();
+ if (!(fileExtesion.endsWith(".jar") || fileExtesion.endsWith(".aar"))) {
+ req.setAttribute("status", "failure");
+ req.setAttribute("cause", "Unsupported file type " + fileExtesion);
+ } else {
+
+ String fileNameOnly ;
+ if (fileName.indexOf("\\") < 0) {
+ fileNameOnly =
+ fileName.substring(fileName.lastIndexOf("/") + 1, fileName
+ .length());
+ } else {
+ fileNameOnly =
+ fileName.substring(fileName.lastIndexOf("\\") + 1, fileName
+ .length());
+ }
+
+ File uploadedFile = new File(serviceDir, fileNameOnly);
+ item.write(uploadedFile);
+ req.setAttribute("status", "success");
+ req.setAttribute("filename", fileNameOnly);
+ }
+ }
+ }
+ } catch (Exception e) {
+ req.setAttribute("status", "failure");
+ req.setAttribute("cause", e.getMessage());
+
+ }
+ }
+ renderView("upload.jsp", req, res);
}
@@ -206,49 +206,49 @@
protected void processEditServicePara(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
- String serviceName = req.getParameter("axisService");
- if (req.getParameter("changePara") != null) {
- AxisService service = configContext.getAxisConfiguration().getService(serviceName);
- if (service != null) {
- ArrayList service_para = service.getParameters();
-
- for (int i = 0; i < service_para.size(); i++) {
- Parameter parameter = (Parameter) service_para.get(i);
- String para = req.getParameter(serviceName + "_" + parameter.getName());
- service.addParameter(new Parameter(parameter.getName(), para));
- }
-
- for (Iterator iterator = service.getOperations(); iterator.hasNext();) {
- AxisOperation axisOperation = (AxisOperation) iterator.next();
- String op_name = axisOperation.getName().getLocalPart();
- ArrayList operation_para = axisOperation.getParameters();
-
- for (int i = 0; i < operation_para.size(); i++) {
- Parameter parameter = (Parameter) operation_para.get(i);
- String para = req.getParameter(op_name + "_" + parameter.getName());
-
- axisOperation.addParameter(new Parameter(parameter.getName(), para));
- }
- }
- }
- res.setContentType("text/html");
- req.setAttribute("status", "Parameters Changed Successfully.");
- req.getSession().removeAttribute(Constants.SERVICE);
- } else {
- AxisService serviceTemp =
- configContext.getAxisConfiguration().getServiceForActivation(serviceName);
- if (serviceTemp.isActive()) {
-
- if (serviceName != null) {
- req.getSession().setAttribute(Constants.SERVICE,
- configContext.getAxisConfiguration().getService(serviceName));
- }
- } else {
- req.setAttribute("status", "Service " + serviceName + " is not an active service" +
- ". \n Only parameters of active services can be edited.");
- }
- }
- renderView(SERVICE_PARA_EDIT_JSP_NAME, req, res);
+ String serviceName = req.getParameter("axisService");
+ if (req.getParameter("changePara") != null) {
+ AxisService service = configContext.getAxisConfiguration().getService(serviceName);
+ if (service != null) {
+ ArrayList service_para = service.getParameters();
+
+ for (int i = 0; i < service_para.size(); i++) {
+ Parameter parameter = (Parameter) service_para.get(i);
+ String para = req.getParameter(serviceName + "_" + parameter.getName());
+ service.addParameter(new Parameter(parameter.getName(), para));
+ }
+
+ for (Iterator iterator = service.getOperations(); iterator.hasNext();) {
+ AxisOperation axisOperation = (AxisOperation) iterator.next();
+ String op_name = axisOperation.getName().getLocalPart();
+ ArrayList operation_para = axisOperation.getParameters();
+
+ for (int i = 0; i < operation_para.size(); i++) {
+ Parameter parameter = (Parameter) operation_para.get(i);
+ String para = req.getParameter(op_name + "_" + parameter.getName());
+
+ axisOperation.addParameter(new Parameter(parameter.getName(), para));
+ }
+ }
+ }
+ res.setContentType("text/html");
+ req.setAttribute("status", "Parameters Changed Successfully.");
+ req.getSession().removeAttribute(Constants.SERVICE);
+ } else {
+ AxisService serviceTemp =
+ configContext.getAxisConfiguration().getServiceForActivation(serviceName);
+ if (serviceTemp.isActive()) {
+
+ if (serviceName != null) {
+ req.getSession().setAttribute(Constants.SERVICE,
+ configContext.getAxisConfiguration().getService(serviceName));
+ }
+ } else {
+ req.setAttribute("status", "Service " + serviceName + " is not an active service" +
+ ". \n Only parameters of active services can be edited.");
+ }
+ }
+ renderView(SERVICE_PARA_EDIT_JSP_NAME, req, res);
}
protected void processEngagingGlobally(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
@@ -488,7 +488,7 @@
protected void processListSingleService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
- req.getSession().setAttribute(Constants.IS_FAULTY, ""); //Clearing out any old values.
+ req.getSession().setAttribute(Constants.IS_FAULTY, ""); //Clearing out any old values.
String serviceName = req.getParameter("serviceName");
if (serviceName != null) {
AxisService service = configContext.getAxisConfiguration().getService(serviceName);
@@ -523,7 +523,7 @@
}
protected void processdisengageModule(HttpServletRequest req, HttpServletResponse res)
- throws IOException, ServletException {
+ throws IOException, ServletException {
String type = req.getParameter("type");
String serviceName = req.getParameter("serviceName");
String moduleName = req.getParameter("module");
@@ -533,22 +533,22 @@
if (type.equals("operation")) {
if (service.isEngaged(module.getName()) || axisConfiguration.isEngaged(module.getName())) {
req.getSession().setAttribute("status", "Can not disengage module " + moduleName +
- ". This module is engaged at a higher level.");
+ ". This module is engaged at a higher level.");
} else {
String opName = req.getParameter("operation");
AxisOperation op = service.getOperation(new QName(opName));
op.disengageModule(module);
req.getSession().setAttribute("status", "Module " + moduleName + " was disengaged from " +
- "operation " + opName + " in service " + serviceName + ".");
+ "operation " + opName + " in service " + serviceName + ".");
}
} else {
if (axisConfiguration.isEngaged(module.getName())) {
req.getSession().setAttribute("status", "Can not disengage module " + moduleName + ". " +
- "This module is engaged at a higher level.");
+ "This module is engaged at a higher level.");
} else {
service.disengageModule(axisConfiguration.getModule(new QName(moduleName)));
req.getSession().setAttribute("status", "Module " + moduleName + " was disengaged from" +
- " service " + serviceName + ".");
+ " service " + serviceName + ".");
}
}
renderView("disengage.jsp", req, res);
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/ApplicationXMLFormatter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisRequestEntity.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisRequestEntity.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisRequestEntity.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisRequestEntity.java Sun Feb 25 11:56:59 2007
@@ -37,86 +37,86 @@
* Axis2 message formatter object.
*/
public class AxisRequestEntity implements RequestEntity {
-
- private MessageFormatter messageFormatter;
-
- private boolean chunked = false;
-
- private MessageContext messageContext;
-
- private byte[] bytes;
-
- private boolean isAllowedRetry;
-
- private OMOutputFormat format;
-
- private String soapAction;
-
- /**
- * Method calls to this request entity are delegated to the following Axis2
- * message formatter object.
- *
- * @param messageFormatter
- */
- public AxisRequestEntity(MessageFormatter messageFormatter,
- MessageContext msgContext, OMOutputFormat format,String soapAction, boolean chunked,boolean isAllowedRetry) {
- this.messageFormatter = messageFormatter;
- this.messageContext = msgContext;
- this.chunked = chunked;
+
+ private MessageFormatter messageFormatter;
+
+ private boolean chunked = false;
+
+ private MessageContext messageContext;
+
+ private byte[] bytes;
+
+ private boolean isAllowedRetry;
+
+ private OMOutputFormat format;
+
+ private String soapAction;
+
+ /**
+ * Method calls to this request entity are delegated to the following Axis2
+ * message formatter object.
+ *
+ * @param messageFormatter
+ */
+ public AxisRequestEntity(MessageFormatter messageFormatter,
+ MessageContext msgContext, OMOutputFormat format,String soapAction, boolean chunked,boolean isAllowedRetry) {
+ this.messageFormatter = messageFormatter;
+ this.messageContext = msgContext;
+ this.chunked = chunked;
this.isAllowedRetry = isAllowedRetry;
this.format = format;
this.soapAction = soapAction;
- }
-
- public boolean isRepeatable() {
- // All Axis2 request entity implementations were returning this true
- // So we return true as defualt
- return true;
- }
-
- public void writeRequest(OutputStream outStream) throws IOException {
- Object gzip = messageContext.getOptions().getProperty(
- HTTPConstants.MC_GZIP_REQUEST);
- if (gzip != null && JavaUtils.isTrueExplicitly(gzip) && chunked) {
- outStream = new GZIPOutputStream(outStream);
- }
- try {
- if (chunked) {
- messageFormatter.writeTo(messageContext,format,outStream, isAllowedRetry);
- } else {
- if (bytes == null) {
- bytes = messageFormatter.getBytes(messageContext,format);
- }
- outStream.write(bytes);
- }
- if (outStream instanceof GZIPOutputStream) {
- ((GZIPOutputStream) outStream).finish();
- }
- outStream.flush();
- } catch (FactoryConfigurationError e) {
- throw new AxisFault(e);
- } catch (IOException e) {
- throw new AxisFault(e);
- }
-
- }
-
- public long getContentLength() {
- if (chunked)
- {
- return -1;
- }
- if (bytes == null) {
- try {
- bytes = messageFormatter.getBytes(messageContext, format);
- } catch (AxisFault e) {
- return -1;
- }
- }
- return bytes.length;
- }
-
- public String getContentType() {
- return messageFormatter.getContentType(messageContext,format,soapAction);
- }
+ }
+
+ public boolean isRepeatable() {
+ // All Axis2 request entity implementations were returning this true
+ // So we return true as defualt
+ return true;
+ }
+
+ public void writeRequest(OutputStream outStream) throws IOException {
+ Object gzip = messageContext.getOptions().getProperty(
+ HTTPConstants.MC_GZIP_REQUEST);
+ if (gzip != null && JavaUtils.isTrueExplicitly(gzip) && chunked) {
+ outStream = new GZIPOutputStream(outStream);
+ }
+ try {
+ if (chunked) {
+ messageFormatter.writeTo(messageContext,format,outStream, isAllowedRetry);
+ } else {
+ if (bytes == null) {
+ bytes = messageFormatter.getBytes(messageContext,format);
+ }
+ outStream.write(bytes);
+ }
+ if (outStream instanceof GZIPOutputStream) {
+ ((GZIPOutputStream) outStream).finish();
+ }
+ outStream.flush();
+ } catch (FactoryConfigurationError e) {
+ throw new AxisFault(e);
+ } catch (IOException e) {
+ throw new AxisFault(e);
+ }
+
+ }
+
+ public long getContentLength() {
+ if (chunked)
+ {
+ return -1;
+ }
+ if (bytes == null) {
+ try {
+ bytes = messageFormatter.getBytes(messageContext, format);
+ } catch (AxisFault e) {
+ return -1;
+ }
+ }
+ return bytes.length;
+ }
+
+ public String getContentType() {
+ return messageFormatter.getContentType(messageContext,format,soapAction);
+ }
}
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisRequestEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Sun Feb 25 11:56:59 2007
@@ -54,192 +54,192 @@
import java.util.zip.GZIPOutputStream;
public class CommonsHTTPTransportSender extends AbstractHandler implements
- TransportSender {
+ TransportSender {
- protected static final String PROXY_HOST_NAME = "proxy_host";
+ protected static final String PROXY_HOST_NAME = "proxy_host";
- protected static final String PROXY_PORT = "proxy_port";
+ protected static final String PROXY_PORT = "proxy_port";
- int soTimeout = HTTPConstants.DEFAULT_SO_TIMEOUT;
+ int soTimeout = HTTPConstants.DEFAULT_SO_TIMEOUT;
- /**
- * proxydiscription
- */
- protected TransportOutDescription proxyOutSetting = null;
-
- private static final Log log = LogFactory
- .getLog(CommonsHTTPTransportSender.class);
-
- protected String httpVersion = HTTPConstants.HEADER_PROTOCOL_11;
-
- private boolean chunked = false;
-
- int connectionTimeout = HTTPConstants.DEFAULT_CONNECTION_TIMEOUT;
-
- public void cleanup(MessageContext msgContext) throws AxisFault {
- HttpMethod httpMethod = (HttpMethod) msgContext
- .getProperty(HTTPConstants.HTTP_METHOD);
-
- if (httpMethod != null) {
- httpMethod.releaseConnection();
- }
- }
-
- public void init(ConfigurationContext confContext,
- TransportOutDescription transportOut) throws AxisFault {
-
- // <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter> or
- // <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> is
- // checked
- Parameter version = transportOut
- .getParameter(HTTPConstants.PROTOCOL_VERSION);
- if (version != null) {
- if (HTTPConstants.HEADER_PROTOCOL_11.equals(version.getValue())) {
- httpVersion = HTTPConstants.HEADER_PROTOCOL_11;
-
- Parameter transferEncoding = transportOut
- .getParameter(HTTPConstants.HEADER_TRANSFER_ENCODING);
-
- if ((transferEncoding != null)
- && HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED
- .equals(transferEncoding.getValue())) {
- chunked = true;
- }
- } else if (HTTPConstants.HEADER_PROTOCOL_10.equals(version
- .getValue())) {
- httpVersion = HTTPConstants.HEADER_PROTOCOL_10;
- } else {
- throw new AxisFault("Parameter "
- + HTTPConstants.PROTOCOL_VERSION
- + " Can have values only HTTP/1.0 or HTTP/1.1");
- }
- }
-
- // Get the timeout values from the configuration
- try {
- Parameter tempSoTimeoutParam = transportOut
- .getParameter(HTTPConstants.SO_TIMEOUT);
- Parameter tempConnTimeoutParam = transportOut
- .getParameter(HTTPConstants.CONNECTION_TIMEOUT);
-
- if (tempSoTimeoutParam != null) {
- soTimeout = Integer.parseInt((String) tempSoTimeoutParam
- .getValue());
- }
-
- if (tempConnTimeoutParam != null) {
- connectionTimeout = Integer
- .parseInt((String) tempConnTimeoutParam.getValue());
- }
- } catch (NumberFormatException nfe) {
-
- // If there's a problem log it and use the default values
- log.error("Invalid timeout value format: not a number", nfe);
- }
- }
-
- public void stop() {
- // Any code that , need to invoke when sender stop
- }
-
- public InvocationResponse invoke(MessageContext msgContext)
- throws AxisFault {
- try {
- OMOutputFormat format = new OMOutputFormat();
- // if (!msgContext.isDoingMTOM())
- msgContext.setDoingMTOM(HTTPTransportUtils.doWriteMTOM(msgContext));
- msgContext.setDoingSwA(HTTPTransportUtils.doWriteSwA(msgContext));
- msgContext.setDoingREST(HTTPTransportUtils.isDoingREST(msgContext));
- format.setSOAP11(msgContext.isSOAP11());
- format.setDoOptimize(msgContext.isDoingMTOM());
- format.setDoingSWA(msgContext.isDoingSwA());
- format.setCharSetEncoding(HTTPTransportUtils
- .getCharSetEncoding(msgContext));
-
- Object mimeBoundaryProperty = msgContext
- .getProperty(Constants.Configuration.MIME_BOUNDARY);
- if (mimeBoundaryProperty != null) {
- format.setMimeBoundary((String) mimeBoundaryProperty);
- }
-
- TransportOutDescription transportOut = msgContext.getConfigurationContext().
- getAxisConfiguration().getTransportOut(new QName (Constants.TRANSPORT_HTTP));
-
- //if a parameter hs set been set, we will omit the SOAP action for SOAP 1.2
- if (transportOut!=null) {
- Parameter param = transportOut.getParameter(HTTPConstants.OMIT_SOAP_12_ACTION);
- Object value = null;
- if (param!=null)
- value = param.getValue();
-
- if (value!=null && JavaUtils.isTrueExplicitly(value)) {
- if (msgContext.isSOAP11()!=true) {
- msgContext.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean.TRUE);
- }
- }
- }
-
- // Trasnport URL can be different from the WSA-To. So processing
- // that now.
- EndpointReference epr = null;
- String transportURL = (String) msgContext
- .getProperty(Constants.Configuration.TRANSPORT_URL);
-
- if (transportURL != null) {
- epr = new EndpointReference(transportURL);
- } else if (msgContext.getTo() != null
- && !msgContext.getTo().hasAnonymousAddress()) {
- epr = msgContext.getTo();
- }
-
- // Check for the REST behaviour, if you desire rest beahaviour
- // put a <parameter name="doREST" value="true"/> at the
- // server.xml/client.xml file
- // ######################################################
- // Change this place to change the wsa:toepr
- // epr = something
- // ######################################################
-
- if ((epr != null) && (!epr.hasNoneAddress())) {
- writeMessageWithCommons(msgContext, epr, format);
- } else if (msgContext.getProperty(MessageContext.TRANSPORT_OUT) != null) {
- sendUsingOutputStream(msgContext, format);
- } else {
- throw new AxisFault(
- "Both the TO and MessageContext.TRANSPORT_OUT property are Null, No where to send");
- }
-
- if (msgContext.getOperationContext() != null) {
- msgContext.getOperationContext().setProperty(
- Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
- }
- } catch (XMLStreamException e) {
- log.debug(e);
- throw new AxisFault(e);
- } catch (FactoryConfigurationError e) {
- log.debug(e);
- throw new AxisFault(e);
- } catch (IOException e) {
- log.debug(e);
- throw new AxisFault(e);
- }
- return InvocationResponse.CONTINUE;
- }
+ /**
+ * proxydiscription
+ */
+ protected TransportOutDescription proxyOutSetting = null;
- private void sendUsingOutputStream(MessageContext msgContext,
- OMOutputFormat format) throws AxisFault, XMLStreamException {
+ private static final Log log = LogFactory
+ .getLog(CommonsHTTPTransportSender.class);
+
+ protected String httpVersion = HTTPConstants.HEADER_PROTOCOL_11;
+
+ private boolean chunked = false;
+
+ int connectionTimeout = HTTPConstants.DEFAULT_CONNECTION_TIMEOUT;
+
+ public void cleanup(MessageContext msgContext) throws AxisFault {
+ HttpMethod httpMethod = (HttpMethod) msgContext
+ .getProperty(HTTPConstants.HTTP_METHOD);
+
+ if (httpMethod != null) {
+ httpMethod.releaseConnection();
+ }
+ }
+
+ public void init(ConfigurationContext confContext,
+ TransportOutDescription transportOut) throws AxisFault {
+
+ // <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter> or
+ // <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> is
+ // checked
+ Parameter version = transportOut
+ .getParameter(HTTPConstants.PROTOCOL_VERSION);
+ if (version != null) {
+ if (HTTPConstants.HEADER_PROTOCOL_11.equals(version.getValue())) {
+ httpVersion = HTTPConstants.HEADER_PROTOCOL_11;
+
+ Parameter transferEncoding = transportOut
+ .getParameter(HTTPConstants.HEADER_TRANSFER_ENCODING);
+
+ if ((transferEncoding != null)
+ && HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED
+ .equals(transferEncoding.getValue())) {
+ chunked = true;
+ }
+ } else if (HTTPConstants.HEADER_PROTOCOL_10.equals(version
+ .getValue())) {
+ httpVersion = HTTPConstants.HEADER_PROTOCOL_10;
+ } else {
+ throw new AxisFault("Parameter "
+ + HTTPConstants.PROTOCOL_VERSION
+ + " Can have values only HTTP/1.0 or HTTP/1.1");
+ }
+ }
+
+ // Get the timeout values from the configuration
+ try {
+ Parameter tempSoTimeoutParam = transportOut
+ .getParameter(HTTPConstants.SO_TIMEOUT);
+ Parameter tempConnTimeoutParam = transportOut
+ .getParameter(HTTPConstants.CONNECTION_TIMEOUT);
+
+ if (tempSoTimeoutParam != null) {
+ soTimeout = Integer.parseInt((String) tempSoTimeoutParam
+ .getValue());
+ }
+
+ if (tempConnTimeoutParam != null) {
+ connectionTimeout = Integer
+ .parseInt((String) tempConnTimeoutParam.getValue());
+ }
+ } catch (NumberFormatException nfe) {
+
+ // If there's a problem log it and use the default values
+ log.error("Invalid timeout value format: not a number", nfe);
+ }
+ }
+
+ public void stop() {
+ // Any code that , need to invoke when sender stop
+ }
+
+ public InvocationResponse invoke(MessageContext msgContext)
+ throws AxisFault {
+ try {
+ OMOutputFormat format = new OMOutputFormat();
+ // if (!msgContext.isDoingMTOM())
+ msgContext.setDoingMTOM(HTTPTransportUtils.doWriteMTOM(msgContext));
+ msgContext.setDoingSwA(HTTPTransportUtils.doWriteSwA(msgContext));
+ msgContext.setDoingREST(HTTPTransportUtils.isDoingREST(msgContext));
+ format.setSOAP11(msgContext.isSOAP11());
+ format.setDoOptimize(msgContext.isDoingMTOM());
+ format.setDoingSWA(msgContext.isDoingSwA());
+ format.setCharSetEncoding(HTTPTransportUtils
+ .getCharSetEncoding(msgContext));
+
+ Object mimeBoundaryProperty = msgContext
+ .getProperty(Constants.Configuration.MIME_BOUNDARY);
+ if (mimeBoundaryProperty != null) {
+ format.setMimeBoundary((String) mimeBoundaryProperty);
+ }
+
+ TransportOutDescription transportOut = msgContext.getConfigurationContext().
+ getAxisConfiguration().getTransportOut(new QName (Constants.TRANSPORT_HTTP));
+
+ //if a parameter hs set been set, we will omit the SOAP action for SOAP 1.2
+ if (transportOut!=null) {
+ Parameter param = transportOut.getParameter(HTTPConstants.OMIT_SOAP_12_ACTION);
+ Object value = null;
+ if (param!=null)
+ value = param.getValue();
+
+ if (value!=null && JavaUtils.isTrueExplicitly(value)) {
+ if (msgContext.isSOAP11()!=true) {
+ msgContext.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean.TRUE);
+ }
+ }
+ }
+
+ // Trasnport URL can be different from the WSA-To. So processing
+ // that now.
+ EndpointReference epr = null;
+ String transportURL = (String) msgContext
+ .getProperty(Constants.Configuration.TRANSPORT_URL);
+
+ if (transportURL != null) {
+ epr = new EndpointReference(transportURL);
+ } else if (msgContext.getTo() != null
+ && !msgContext.getTo().hasAnonymousAddress()) {
+ epr = msgContext.getTo();
+ }
+
+ // Check for the REST behaviour, if you desire rest beahaviour
+ // put a <parameter name="doREST" value="true"/> at the
+ // server.xml/client.xml file
+ // ######################################################
+ // Change this place to change the wsa:toepr
+ // epr = something
+ // ######################################################
+
+ if ((epr != null) && (!epr.hasNoneAddress())) {
+ writeMessageWithCommons(msgContext, epr, format);
+ } else if (msgContext.getProperty(MessageContext.TRANSPORT_OUT) != null) {
+ sendUsingOutputStream(msgContext, format);
+ } else {
+ throw new AxisFault(
+ "Both the TO and MessageContext.TRANSPORT_OUT property are Null, No where to send");
+ }
+
+ if (msgContext.getOperationContext() != null) {
+ msgContext.getOperationContext().setProperty(
+ Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
+ }
+ } catch (XMLStreamException e) {
+ log.debug(e);
+ throw new AxisFault(e);
+ } catch (FactoryConfigurationError e) {
+ log.debug(e);
+ throw new AxisFault(e);
+ } catch (IOException e) {
+ log.debug(e);
+ throw new AxisFault(e);
+ }
+ return InvocationResponse.CONTINUE;
+ }
+
+ private void sendUsingOutputStream(MessageContext msgContext,
+ OMOutputFormat format) throws AxisFault, XMLStreamException {
OutputStream out = (OutputStream) msgContext
- .getProperty(MessageContext.TRANSPORT_OUT);
+ .getProperty(MessageContext.TRANSPORT_OUT);
- // I Don't thinik we need this check.. Content type needs to be set in
- // any case. (thilina)
- // if (msgContext.isServerSide()) {
- OutTransportInfo transportInfo = (OutTransportInfo) msgContext
- .getProperty(Constants.OUT_TRANSPORT_INFO);
+ // I Don't thinik we need this check.. Content type needs to be set in
+ // any case. (thilina)
+ // if (msgContext.isServerSide()) {
+ OutTransportInfo transportInfo = (OutTransportInfo) msgContext
+ .getProperty(Constants.OUT_TRANSPORT_INFO);
- ServletBasedOutTransportInfo servletBasedOutTransportInfo = null;
+ ServletBasedOutTransportInfo servletBasedOutTransportInfo = null;
if (transportInfo != null && transportInfo instanceof ServletBasedOutTransportInfo) {
servletBasedOutTransportInfo =
(ServletBasedOutTransportInfo) transportInfo;
@@ -282,71 +282,71 @@
}
private void writeMessageWithCommons(MessageContext messageContext,
- EndpointReference toEPR, OMOutputFormat format)
- throws AxisFault {
- try {
- URL url = new URL(toEPR.getAddress());
+ EndpointReference toEPR, OMOutputFormat format)
+ throws AxisFault {
+ try {
+ URL url = new URL(toEPR.getAddress());
- // select the Message Sender depending on the REST status
- AbstractHTTPSender sender;
+ // select the Message Sender depending on the REST status
+ AbstractHTTPSender sender;
sender = new HTTPSender();
- if (messageContext.getProperty(HTTPConstants.CHUNKED) != null) {
- chunked = JavaUtils.isTrueExplicitly(messageContext
- .getProperty(HTTPConstants.CHUNKED));
- }
-
- if (messageContext.getProperty(HTTPConstants.HTTP_PROTOCOL_VERSION) != null) {
- httpVersion = (String) messageContext
- .getProperty(HTTPConstants.HTTP_PROTOCOL_VERSION);
- }
- // Following order needed to be preserved because,
- // HTTP/1.0 does not support chunk encoding
- sender.setChunked(chunked);
- sender.setHttpVersion(httpVersion);
- sender.setFormat(format);
-
- sender.send(messageContext, url, findSOAPAction(messageContext));
- } catch (MalformedURLException e) {
- log.debug(e);
- throw new AxisFault(e);
- } catch (HttpException e) {
- log.debug(e);
- throw new AxisFault(e);
- } catch (IOException e) {
- log.debug(e);
- throw new AxisFault(e);
- }
- }
-
- private static String findSOAPAction(MessageContext messageContext) {
- String soapActionString = null;
-
- Object disableSoapAction = messageContext.getOptions().getProperty(
- Constants.Configuration.DISABLE_SOAP_ACTION);
-
- if (!JavaUtils.isTrueExplicitly(disableSoapAction)) {
- // first try to get the SOAP action from message context
- soapActionString = messageContext.getSoapAction();
- if ((soapActionString == null) || (soapActionString.length() == 0)) {
- // now let's try to get WSA action
- soapActionString = messageContext.getWSAAction();
- if (messageContext.getAxisOperation() != null
- && ((soapActionString == null) || (soapActionString
- .length() == 0))) {
- // last option is to get it from the axis operation
- soapActionString = messageContext.getAxisOperation()
- .getInputAction();
- }
- }
- }
-
- //Since action is optional for SOAP 1.2 we can return null here.
- if (soapActionString == null && messageContext.isSOAP11()) {
- soapActionString = "\"\"";
- }
-
- return soapActionString;
- }
+ if (messageContext.getProperty(HTTPConstants.CHUNKED) != null) {
+ chunked = JavaUtils.isTrueExplicitly(messageContext
+ .getProperty(HTTPConstants.CHUNKED));
+ }
+
+ if (messageContext.getProperty(HTTPConstants.HTTP_PROTOCOL_VERSION) != null) {
+ httpVersion = (String) messageContext
+ .getProperty(HTTPConstants.HTTP_PROTOCOL_VERSION);
+ }
+ // Following order needed to be preserved because,
+ // HTTP/1.0 does not support chunk encoding
+ sender.setChunked(chunked);
+ sender.setHttpVersion(httpVersion);
+ sender.setFormat(format);
+
+ sender.send(messageContext, url, findSOAPAction(messageContext));
+ } catch (MalformedURLException e) {
+ log.debug(e);
+ throw new AxisFault(e);
+ } catch (HttpException e) {
+ log.debug(e);
+ throw new AxisFault(e);
+ } catch (IOException e) {
+ log.debug(e);
+ throw new AxisFault(e);
+ }
+ }
+
+ private static String findSOAPAction(MessageContext messageContext) {
+ String soapActionString = null;
+
+ Object disableSoapAction = messageContext.getOptions().getProperty(
+ Constants.Configuration.DISABLE_SOAP_ACTION);
+
+ if (!JavaUtils.isTrueExplicitly(disableSoapAction)) {
+ // first try to get the SOAP action from message context
+ soapActionString = messageContext.getSoapAction();
+ if ((soapActionString == null) || (soapActionString.length() == 0)) {
+ // now let's try to get WSA action
+ soapActionString = messageContext.getWSAAction();
+ if (messageContext.getAxisOperation() != null
+ && ((soapActionString == null) || (soapActionString
+ .length() == 0))) {
+ // last option is to get it from the axis operation
+ soapActionString = messageContext.getAxisOperation()
+ .getInputAction();
+ }
+ }
+ }
+
+ //Since action is optional for SOAP 1.2 we can return null here.
+ if (soapActionString == null && messageContext.isSOAP11()) {
+ soapActionString = "\"\"";
+ }
+
+ return soapActionString;
+ }
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsTransportHeaders.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsTransportHeaders.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsTransportHeaders.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsTransportHeaders.java Sun Feb 25 11:56:59 2007
@@ -24,102 +24,102 @@
import org.apache.commons.httpclient.Header;
public class CommonsTransportHeaders implements Map {
- private Header[] headers;
+ private Header[] headers;
- HashMap headerMap = null;
+ HashMap headerMap = null;
- public CommonsTransportHeaders(Header[] headers) {
- this.headers = headers;
- }
-
- private void init() {
- headerMap = new HashMap();
-
- for (int i = 0; i < headers.length; i++) {
- headerMap.put(headers[i].getName(), headers[i].getValue());
- }
- }
-
- public int size() {
- if (headerMap == null) {
- init();
- }
- return headerMap.size();
- }
-
- public void clear() {
- if (headerMap != null) {
- headerMap.clear();
- }
- }
-
- public boolean isEmpty() {
- if (headerMap == null) {
- init();
- }
- return headerMap.isEmpty();
- }
-
- public boolean containsKey(Object key) {
- if (headerMap == null) {
- init();
- }
- return headerMap.containsKey(key);
- }
-
- public boolean containsValue(Object value) {
- if (headerMap == null) {
- init();
- }
- return headerMap.containsValue(value);
- }
-
- public Collection values() {
- if (headerMap == null) {
- init();
- }
- return headerMap.values();
- }
-
- public void putAll(Map t) {
- if (headerMap == null) {
- init();
- }
- headerMap.putAll(t);
- }
-
- public Set entrySet() {
- if (headerMap == null) {
- init();
- }
- return headerMap.entrySet();
- }
-
- public Set keySet() {
- if (headerMap == null) {
- init();
- }
- return headerMap.keySet();
- }
-
- public Object get(Object key) {
- if (headerMap == null) {
- init();
- }
- return headerMap.get(key);
- }
-
- public Object remove(Object key) {
- if (headerMap == null) {
- init();
- }
- return headerMap.remove(key);
- }
-
- public Object put(Object key, Object value) {
- if (headerMap == null) {
- init();
- }
- return headerMap.put(key, value);
- }
+ public CommonsTransportHeaders(Header[] headers) {
+ this.headers = headers;
+ }
+
+ private void init() {
+ headerMap = new HashMap();
+
+ for (int i = 0; i < headers.length; i++) {
+ headerMap.put(headers[i].getName(), headers[i].getValue());
+ }
+ }
+
+ public int size() {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.size();
+ }
+
+ public void clear() {
+ if (headerMap != null) {
+ headerMap.clear();
+ }
+ }
+
+ public boolean isEmpty() {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.isEmpty();
+ }
+
+ public boolean containsKey(Object key) {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.containsValue(value);
+ }
+
+ public Collection values() {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.values();
+ }
+
+ public void putAll(Map t) {
+ if (headerMap == null) {
+ init();
+ }
+ headerMap.putAll(t);
+ }
+
+ public Set entrySet() {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.entrySet();
+ }
+
+ public Set keySet() {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.keySet();
+ }
+
+ public Object get(Object key) {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.get(key);
+ }
+
+ public Object remove(Object key) {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.remove(key);
+ }
+
+ public Object put(Object key, Object value) {
+ if (headerMap == null) {
+ init();
+ }
+ return headerMap.put(key, value);
+ }
}
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsTransportHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Sun Feb 25 11:56:59 2007
@@ -135,32 +135,32 @@
}
/**
- * Utility method to query CharSetEncoding. First look in the
- * MessageContext. If it's not there look in the OpContext. Use the defualt,
- * if it's not given in either contexts.
- *
- * @param msgContext
- * @return CharSetEncoding
- */
+ * Utility method to query CharSetEncoding. First look in the
+ * MessageContext. If it's not there look in the OpContext. Use the defualt,
+ * if it's not given in either contexts.
+ *
+ * @param msgContext
+ * @return CharSetEncoding
+ */
public static String getCharSetEncoding(MessageContext msgContext) {
- String charSetEnc = (String) msgContext
- .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
+ String charSetEnc = (String) msgContext
+ .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
- if (charSetEnc == null) {
- OperationContext opctx = msgContext.getOperationContext();
- if (opctx != null) {
- charSetEnc = (String) opctx
- .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
- }
- /**
- * If the char set enc is still not found use the default
- */
- if (charSetEnc == null) {
- charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING;
- }
- }
- return charSetEnc;
- }
+ if (charSetEnc == null) {
+ OperationContext opctx = msgContext.getOperationContext();
+ if (opctx != null) {
+ charSetEnc = (String) opctx
+ .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
+ }
+ /**
+ * If the char set enc is still not found use the default
+ */
+ if (charSetEnc == null) {
+ charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING;
+ }
+ }
+ return charSetEnc;
+ }
public static boolean processHTTPGetRequest(MessageContext msgContext,
OutputStream out, String soapAction, String requestURI,
@@ -238,39 +238,39 @@
String soapNS = null;
if (contentType != null) {
- if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
- soapVersion = VERSION_SOAP12;
- soapNS = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
- processContentTypeForAction(contentType, msgContext);
- } else if (contentType
- .indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
- soapVersion = VERSION_SOAP11;
- soapNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
- } else if (isRESTRequest(contentType)) {
+ if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
+ soapVersion = VERSION_SOAP12;
+ soapNS = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+ processContentTypeForAction(contentType, msgContext);
+ } else if (contentType
+ .indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
+ soapVersion = VERSION_SOAP11;
+ soapNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+ } else if (isRESTRequest(contentType)) {
// If REST, construct a SOAP11 envelope to hold the rest message and
// indicate that this is a REST message.
soapVersion = VERSION_SOAP11;
soapNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
msgContext.setDoingREST(true);
}
- if (JavaUtils.indexOfIgnoreCase(contentType,
- HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) > -1) {
- // It is MIME (MTOM or SwA)
- isMIME = true;
- } else if (soapVersion == VERSION_SOAP11) {
- // Deployment configuration parameter
- Parameter enableREST = msgContext
- .getParameter(Constants.Configuration.ENABLE_REST);
- if ((soapActionHeader == null) && (enableREST != null)) {
- if (Constants.VALUE_TRUE.equals(enableREST.getValue())) {
- // If the content Type is text/xml (BTW which is the
- // SOAP 1.1 Content type ) and the SOAP Action is
- // absent it is rest !!
- msgContext.setDoingREST(true);
- }
- }
- }
- }
+ if (JavaUtils.indexOfIgnoreCase(contentType,
+ HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) > -1) {
+ // It is MIME (MTOM or SwA)
+ isMIME = true;
+ } else if (soapVersion == VERSION_SOAP11) {
+ // Deployment configuration parameter
+ Parameter enableREST = msgContext
+ .getParameter(Constants.Configuration.ENABLE_REST);
+ if ((soapActionHeader == null) && (enableREST != null)) {
+ if (Constants.VALUE_TRUE.equals(enableREST.getValue())) {
+ // If the content Type is text/xml (BTW which is the
+ // SOAP 1.1 Content type ) and the SOAP Action is
+ // absent it is rest !!
+ msgContext.setDoingREST(true);
+ }
+ }
+ }
+ }
envelope = TransportUtils.createSOAPMessage(msgContext,in,soapNS,isMIME,contentType,charSetEnc);
msgContext.setEnvelope(envelope);
AxisEngine engine = new AxisEngine(msgContext.getConfigurationContext());
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java Sun Feb 25 11:56:59 2007
@@ -265,7 +265,7 @@
response.setStatusLine(new BasicStatusLine(ver, 202, "OK"));
}
}
-
+
public String getHostAddress(HttpRequest request) throws java.net.SocketException{
try {
Header hostHeader = request.getFirstHeader("host");
@@ -277,11 +277,11 @@
}
return HttpUtils.getIpAddress();
- }
+ }
class SimpleHTTPRequestResponseTransport implements RequestResponseTransport
{
-
+
private CountDownLatch responseReadySignal = new CountDownLatch(1);
RequestResponseTransportStatus status = RequestResponseTransportStatus.INITIAL;
@@ -293,18 +293,18 @@
public void awaitResponse() throws InterruptedException
{
- status = RequestResponseTransportStatus.WAITING;
- responseReadySignal.await();
+ status = RequestResponseTransportStatus.WAITING;
+ responseReadySignal.await();
}
public void signalResponseReady()
{
- status = RequestResponseTransportStatus.SIGNALLED;
- responseReadySignal.countDown();
+ status = RequestResponseTransportStatus.SIGNALLED;
+ responseReadySignal.countDown();
}
public RequestResponseTransportStatus getStatus() {
- return status;
+ return status;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org