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 az...@apache.org on 2009/12/15 08:12:36 UTC
svn commit: r890676 -
/webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/util/RESTUtil.java
Author: azeez
Date: Tue Dec 15 07:12:35 2009
New Revision: 890676
URL: http://svn.apache.org/viewvc?rev=890676&view=rev
Log:
Handling service & op not found scenario in REST calls
Modified:
webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/util/RESTUtil.java
Modified: webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/util/RESTUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/util/RESTUtil.java?rev=890676&r1=890675&r2=890676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/util/RESTUtil.java (original)
+++ webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/util/RESTUtil.java Tue Dec 15 07:12:35 2009
@@ -58,8 +58,13 @@
msgContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
dispatchAndVerify(msgContext);
in = HTTPTransportUtils.handleGZip(msgContext, in);
- SOAPEnvelope soapEnvelope = TransportUtils
- .createSOAPMessage(msgContext, in, contentType);
+ SOAPEnvelope soapEnvelope;
+ if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null) {
+ soapEnvelope = TransportUtils.createSOAPEnvelope(null);
+ } else {
+ soapEnvelope = TransportUtils.createSOAPMessage(msgContext, in, contentType);
+ }
+
msgContext.setEnvelope(soapEnvelope);
msgContext.setProperty(Constants.Configuration.CONTENT_TYPE,
contentType);
@@ -103,11 +108,14 @@
// 1. First dispatchAndVerify and find out the service and the operation.
dispatchAndVerify(msgContext);
SOAPEnvelope soapEnvelope;
- try {
- soapEnvelope = TransportUtils
- .createSOAPMessage(msgContext, null, contentType);
- } catch (XMLStreamException e) {
- throw AxisFault.makeFault(e);
+ if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null) {
+ soapEnvelope = TransportUtils.createSOAPEnvelope(null);
+ } else {
+ try {
+ soapEnvelope = TransportUtils.createSOAPMessage(msgContext, null, contentType);
+ } catch (XMLStreamException e) {
+ throw AxisFault.makeFault(e);
+ }
}
msgContext.setEnvelope(soapEnvelope);