axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r202483 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/ core/src/org/apache/axis/clientapi/ core/src/org/apache/axis/transport/http/ xml/src/org/apache/axis/soap/impl/llom/soap11/ xml/src/org/apache/axis/soap/impl/llom/...
Date Thu, 30 Jun 2005 05:19:41 GMT
Author: hemapani
Date: Wed Jun 29 22:19:39 2005
New Revision: 202483

URL: http://svn.apache.org/viewcvs?rev=202483&view=rev
Log:
fix writing the correct content type for the soap version

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportSender.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Wed Jun 29
22:19:39 2005
@@ -163,12 +163,6 @@
 
     public static final String LOGGED = "Logged";
 
-    public static interface SOAP {
-        public static final String SOAP_12_CONTENT_TYPE = "application/soap+xml";
-        public static final String SOAP_11_CONTENT_TYPE = "text/xml";
-        //TODO
-        public static final String MTOM_CONTENT_TYPE = "multipart/related";
-    }
 
    public static interface Configuration {
         public static final String DO_REST = "doREST";

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java
Wed Jun 29 22:19:39 2005
@@ -19,7 +19,6 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.axis.Constants;
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.addressing.MessageInformationHeadersCollection;
 import org.apache.axis.addressing.miheaders.RelatesTo;
@@ -31,8 +30,6 @@
 import org.apache.axis.engine.AxisConfiguration;
 import org.apache.axis.engine.AxisEngine;
 import org.apache.axis.engine.AxisFault;
-import org.apache.axis.soap.SOAPEnvelope;
-import org.apache.axis.transport.http.HTTPTransportReceiver;
 import org.apache.wsdl.WSDLConstants;
 
 public class InOnlyMEPClient extends MEPClient {
@@ -65,28 +62,6 @@
         msgctx.setOperationContext(axisop.findOperationContext(msgctx,serviceContext));
 
         engine.send(msgctx);
-
-//        MessageContext response =
-//            new MessageContext(msgctx.getSystemContext(),
-//                msgctx.getSessionContext(),
-//                msgctx.getTransportIn(),
-//                msgctx.getTransportOut());
-//        response.setProperty(
-//            MessageContext.TRANSPORT_IN,
-//            msgctx.getProperty(MessageContext.TRANSPORT_IN));
-//        response.setServerSide(false);
-//        response.setOperationContext(msgctx.getOperationContext());
-//        response.setServiceContext(msgctx.getServiceContext());
-//
-//        if(Constants.TRANSPORT_HTTP.equals(senderTransport.getName().getLocalPart())){
-//            //TODO Fix this we support only the HTTP Sync cases, so we hardcode this
-//            HTTPTransportReceiver receiver = new HTTPTransportReceiver();
-//            receiver.checkForMessage(response, sysContext);
-//            SOAPEnvelope resenvelope = response.getEnvelope();
-//            if (resenvelope!= null && resenvelope.getBody().hasFault()) {
-//                throw new AxisFault(resenvelope.getBody().getFault().getException());
-//            }
-//        }
     }
 
     /**

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
Wed Jun 29 22:19:39 2005
@@ -196,52 +196,6 @@
                     new NonBlockingInvocationWorker(callback, axisop, msgctx));
             }
 
-            //            //TODO start the server
-            //            if (!useSeparateListener) {
-            //                Runnable newThread = new Runnable() {
-            //                    public void run() {
-            //                        try {
-            //                            MessageContext response =
-            //                                new MessageContext(
-            //                                    msgctx.getSessionContext(),
-            //                                    msgctx.getTransportIn(),
-            //                                    msgctx.getTransportOut(),
-            //                                    msgctx.getSystemContext());
-            //                            response.setServerSide(false);
-            //                            response.setProperty(
-            //                                MessageContext.TRANSPORT_READER,
-            //                                msgctx.getProperty(
-            //                                    MessageContext.TRANSPORT_READER));
-            //                            response.setOperationContext(
-            //                                msgctx.getOperationContext());
-            //                            response.setServiceContext(
-            //                                msgctx.getServiceContext());
-            //
-            //                            SOAPEnvelope resenvelope =
-            //                                checkReturnChannel(response);
-            //                            if (resenvelope != null) {
-            //                                response.setEnvelope(resenvelope);
-            //                                AxisEngine engine =
-            //                                    new AxisEngine(
-            //                                        serviceContext.getEngineContext());
-            //                                engine.receive(response);
-            //
-            //                                resenvelope = response.getEnvelope();
-            //                                AsyncResult asyncResult = new AsyncResult();
-            //                                asyncResult.setResult(resenvelope);
-            //                                callback.onComplete(asyncResult);
-            //                            } else {
-            //                                throw new AxisFault("Blocking invocation always
expect a response");
-            //                            }
-            //                        } catch (AxisFault e) {
-            //                            callback.reportError(e);
-            //                        }
-            //
-            //                    }
-            //                };
-            //                (new Thread(newThread)).start();
-            //            }
-
         } catch (OMException e) {
             throw AxisFault.makeFault(e);
         } catch (IOException e) {
@@ -312,38 +266,6 @@
             ListenerManager.makeSureStarted(listenerTransport, serviceContext.getEngineContext());
         }
     }
-
-    //    private SOAPEnvelope checkReturnChannel(MessageContext response) throws AxisFault
{
-    //        SOAPEnvelope resenvelope = null;
-    //        try {
-    //            //TODO Fix this we support only the HTTP Sync cases, so we hardcode this
-    //            if (Constants.TRANSPORT_HTTP.equals(listenerTransport)) {
-    //                HTTPTransportReceiver receiver = new HTTPTransportReceiver();
-    //                resenvelope = receiver.handleHTTPRequest(response, serviceContext.getEngineContext());
-    //            } else if (Constants.TRANSPORT_TCP.equals(listenerTransport)) {
-    //                InputStream inStream = (InputStream) response.getProperty(MessageContext.TRANSPORT_IN);
-    //                response.setProperty(MessageContext.TRANSPORT_IN,null);
-    //                Reader in = new InputStreamReader(inStream);
-    //
-    //                if (in != null) {
-    //                    XMLStreamReader xmlreader =
-    //                        XMLInputFactory.newInstance().createXMLStreamReader(in);
-    //                    StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
-    //                    resenvelope = (SOAPEnvelope) builder.getDocumentElement();
-    //                } else {
-    //                    throw new AxisFault(
-    //                        "Sync invocation expect a proeprty "
-    //                            + MessageContext.TRANSPORT_IN
-    //                            + " set ");
-    //                }
-    //            }
-    //        } catch (XMLStreamException e) {
-    //            throw new AxisFault(e);
-    //        } catch (FactoryConfigurationError e) {
-    //            throw new AxisFault(e);
-    //        }
-    //        return resenvelope;
-    //    }
 
     private void checkTransport(MessageContext msgctx) throws AxisFault {
         if (senderTransport == null) {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportSender.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportSender.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportSender.java
Wed Jun 29 22:19:39 2005
@@ -33,6 +33,8 @@
 import org.apache.axis.description.TransportOutDescription;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.om.OMOutput;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
 import org.apache.axis.transport.AbstractTransportSender;
 
 /**
@@ -62,7 +64,16 @@
             if(doMTOM){
                 buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ").append(OMOutput.getContentType(true)).append("\n");
             }else{
-                buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": text/xml; charset=utf-8\n");
+                String nsURI = msgContext.getEnvelope().getNamespace().getName();
+                           if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI))
{
+                               buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ").append(SOAP12Constants.SOAP_12_CONTENT_TYPE);
+                               buf.append("; charset=utf-8\n");
+                           } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI))
{
+                               buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": text/xml;
charset=utf-8\n");
+                           }else {
+                               throw new AxisFault("Unknown SOAP Version. Current Axis handles
only SOAP 1.1 and SOAP 1.2 messages");
+                           }
+                
             }
             
             buf.append(HTTPConstants.HEADER_ACCEPT).append(": application/soap+xml, application/dime,
multipart/related, text/*\n");

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java
Wed Jun 29 22:19:39 2005
@@ -52,6 +52,7 @@
 import org.apache.axis.soap.SOAPFactory;
 import org.apache.axis.soap.impl.llom.SOAPProcessingException;
 import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis.soap.impl.llom.soap11.SOAP11Factory;
 import org.apache.axis.util.Utils;
 
@@ -77,7 +78,9 @@
 				builder = selectBuilderForMIME(msgContext, in, contentType);
 				envelope = (SOAPEnvelope) builder.getDocumentElement();
 			} else if (contentType != null
-					&& contentType.indexOf(Constants.SOAP.SOAP_11_CONTENT_TYPE) > -1) {
+					&& contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
+                 //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 !!        
 				if ((soapAction == null || soapAction.length() == 0)
 						&& Constants.VALUE_TRUE
 								.equals(msgContext

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java
(original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java
Wed Jun 29 22:19:39 2005
@@ -43,4 +43,7 @@
    public static final String SOAP_FAULT_ACTOR_LOCAL_NAME = "faultactor";
 
    public static final String SOAP_FAULT_DETAIL_LOCAL_NAME = "detail";
+   
+   //SOAP 1.2 Content Type
+   public static final String SOAP_11_CONTENT_TYPE = "text/xml";
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java?rev=202483&r1=202482&r2=202483&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java
(original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java
Wed Jun 29 22:19:39 2005
@@ -57,4 +57,7 @@
 
     // SOAP Fault Role
     public static final String SOAP_FAULT_ROLE_LOCAL_NAME = "Role";
+    
+    //SOAP 1.2 Content Type
+    public static final String SOAP_12_CONTENT_TYPE = "application/soap+xml";
 }



Mime
View raw message