axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r201945 - in /webservices/axis/trunk/java/modules/core/src/org/apache/axis: clientapi/MEPClient.java receivers/RawXMLINOutMessageRecevier.java
Date Mon, 27 Jun 2005 04:56:25 GMT
Author: hemapani
Date: Sun Jun 26 21:56:24 2005
New Revision: 201945

URL: http://svn.apache.org/viewcvs?rev=201945&view=rev
Log:
fixing the http://issues.apache.org/jira/browse/AXIS2-45

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java?rev=201945&r1=201944&r2=201945&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/MEPClient.java
Sun Jun 26 21:56:24 2005
@@ -23,7 +23,6 @@
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.context.ServiceContext;
 import org.apache.axis.description.OperationDescription;
-import org.apache.axis.description.TransportInDescription;
 import org.apache.axis.description.TransportOutDescription;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.om.OMAbstractFactory;
@@ -31,6 +30,8 @@
 import org.apache.axis.soap.SOAPEnvelope;
 import org.apache.axis.soap.SOAPFactory;
 import org.apache.axis.soap.impl.llom.SOAPProcessingException;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
 
 /**
  * This is the Super Class for all the MEPClients, All the MEPClient will extend this.
@@ -38,6 +39,7 @@
 public abstract class MEPClient {
     protected ServiceContext serviceContext;
     protected final String mep;
+    protected String soapVersionURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
 
     public MEPClient(ServiceContext service, String mep) {
         this.serviceContext = service;
@@ -56,23 +58,16 @@
                     + " And the Axis Operations suppiled supports "
                     + axisop.getMessageExchangePattern());
         }
-        
-        if(serviceContext.getServiceConfig().getOperation(axisop.getName()) == null){
+
+        if (serviceContext.getServiceConfig().getOperation(axisop.getName()) == null) {
             serviceContext.getServiceConfig().addOperation(axisop);
         }
     }
 
     protected MessageContext prepareTheSystem(OMElement toSend) throws AxisFault {
-        MessageContext msgctx =
-            new MessageContext(serviceContext.getEngineContext());
+        MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());
 
-        SOAPEnvelope envelope = null;
-        SOAPFactory omfac = OMAbstractFactory.getSOAP11Factory();
-        try {
-            envelope = omfac.getDefaultEnvelope();
-        } catch (SOAPProcessingException e) {
-            throw new AxisFault(e);
-        }
+        SOAPEnvelope envelope = createDefaultSOAPEnvelope();
         envelope.getBody().addChild(toSend);
         msgctx.setEnvelope(envelope);
         return msgctx;
@@ -87,15 +82,32 @@
                 transport = toURL.substring(0, index);
             }
         }
-        
-        if(transport  != null){
+
+        if (transport != null) {
             return serviceContext.getEngineContext().getAxisConfiguration().getTransportOut(
-                                new QName(transport));
-            
-        }else{
+                new QName(transport));
+
+        } else {
             throw new AxisFault("Cannot Infer transport from the URL");
         }
-         
+
+    }
+
+    public SOAPEnvelope createDefaultSOAPEnvelope() {
+        SOAPFactory fac = null;
+        if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
+            fac = OMAbstractFactory.getSOAP12Factory();
+        } else {
+            fac = OMAbstractFactory.getSOAP11Factory();
+        }
+        return fac.getDefaultEnvelope();
+    }
+
+    /**
+     * @param string
+     */
+    public void setSoapVersionURI(String string) {
+        soapVersionURI = string;
     }
 
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java?rev=201945&r1=201944&r2=201945&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java
Sun Jun 26 21:56:24 2005
@@ -73,12 +73,20 @@
         throws AxisFault {
         try {
 
+            SOAPFactory fac = null;
+            String nsURI = msgContext.getEnvelope().getNamespace().getName();
+            if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)) {
+                fac = OMAbstractFactory.getSOAP12Factory();
+            } else {
+                fac = OMAbstractFactory.getSOAP11Factory();
+            }
+
             // get the implementation class for the Web Service
             Object obj = getTheImplementationObject(msgContext);
 
             // find the WebService method
             Class ImplClass = obj.getClass();
-            DependancyManager.configureBusinussLogicProvider(obj,msgContext);
+            DependancyManager.configureBusinussLogicProvider(obj, msgContext);
 
             OperationDescription op = msgContext.getOperationContext().getAxisOperation();
             if (op == null) {
@@ -109,7 +117,7 @@
 
                     // invoke the WebService
                     OMElement result = (OMElement) method.invoke(obj, parms);
-                    envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
+                    envelope = fac.getDefaultEnvelope();
                     envelope.getBody().setFirstChild(result);
 
                 } else if (WSDLService.STYLE_RPC.equals(style)) {
@@ -118,7 +126,6 @@
 
                     // invoke the WebService
                     OMElement result = (OMElement) method.invoke(obj, parms);
-                    SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
                     envelope = fac.getDefaultEnvelope();
 
                     OMNamespace ns = fac.createOMNamespace("http://soapenc/", "res");
@@ -129,21 +136,13 @@
                     throw new AxisFault("Unknown style ");
                 }
                 newmsgContext.setEnvelope(envelope);
-            } else if((parameters != null)
-                    && (parameters.length == 0)){
-                        SOAPFactory fac = null;
-                String nsURI = msgContext.getEnvelope().getNamespace().getName();
-                if(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsURI)){
-                    fac = OMAbstractFactory.getSOAP12Factory();
-                }else{
-                    fac = OMAbstractFactory.getSOAP11Factory();
-                }
-                
+            } else if ((parameters != null) && (parameters.length == 0)) {
+
                 SOAPEnvelope envelope = fac.getDefaultEnvelope();
                 String style = msgContext.getOperationContext().getAxisOperation().getStyle();
 
                 if (WSDLService.STYLE_DOC.equals(style)) {
-                    
+
                     Object[] parms = new Object[0];
 
                     // invoke the WebService
@@ -151,7 +150,7 @@
                     envelope.getBody().setFirstChild(result);
 
                 } else if (WSDLService.STYLE_RPC.equals(style)) {
-                    
+
                     Object[] parms = new Object[0];
 
                     // invoke the WebService
@@ -165,7 +164,7 @@
                     throw new AxisFault("Unknown style ");
                 }
                 newmsgContext.setEnvelope(envelope);
-            }else {
+            } else {
                 throw new AxisFault(
                     "Raw Xml provider supports only the methods bearing the signature public
OMElement "
                         + "<method-name>(OMElement) where the method name is
anything");



Mime
View raw message