ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r154818 - in webservices/axis/trunk/java/modules: core/src/java/org/apache/axis/ core/src/java/org/apache/axis/engine/ core/src/java/org/apache/axis/providers/ core/src/java/org/apache/axis/transport/http/ samples/ samples/src/java/interop/doclit/
Date Tue, 22 Feb 2005 07:42:13 GMT
Author: hemapani
Date: Mon Feb 21 23:42:10 2005
New Revision: 154818

URL: http://svn.apache.org/viewcvs?view=rev&rev=154818
Log:
fix the providers for doc-lit

Modified:
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/AxisEngine.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/providers/RawXMLProvider.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/HTTPTransportSender.java
    webservices/axis/trunk/java/modules/samples/maven.xml
    webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/InteropProvider.java
    webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/service.xml

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java Mon Feb
21 23:42:10 2005
@@ -102,5 +102,5 @@
     /**
      * Field METHOD_NAME_ESCAPE_CHARACTOR
      */
-    public static final char METHOD_NAME_ESCAPE_CHARACTOR = '#';
+    public static final char METHOD_NAME_ESCAPE_CHARACTOR = '?';
 }

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/AxisEngine.java?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/AxisEngine.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/AxisEngine.java
Mon Feb 21 23:42:10 2005
@@ -15,11 +15,14 @@
  */
 package org.apache.axis.engine;
 
+
+
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.description.AxisGlobal;
 import org.apache.axis.description.AxisService;
 import org.apache.axis.description.AxisTransport;
 import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.SOAPBody;
 import org.apache.axis.om.SOAPEnvelope;
 import org.apache.axis.transport.TransportSenderLocator;
 import org.apache.commons.logging.Log;
@@ -131,11 +134,13 @@
             context.setProcessingFault(true);
 
             // create a SOAP envelope with the Fault
+            MessageContext faultContext = new MessageContext(context.getGlobalContext().getRegistry(),context.getProperties(),context.getSessionContext());
             SOAPEnvelope envelope =
                     OMFactory.newInstance().getDefaultEnvelope();
 
             // TODO do we need to set old Headers back?
-            envelope.getBody().addFault(new AxisFault(e.getMessage(), e));
+            SOAPBody body = envelope.getBody();
+            body.addFault(new AxisFault(e.getMessage(), e));
             context.setEnvelope(envelope);
 
             // send the error
@@ -195,6 +200,7 @@
             // startet rolling
             chain.invoke(context);
         } catch (AxisFault error) {
+            error.printStackTrace();
             handleFault(context, error);
         }
     }

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/Dispatcher.java
Mon Feb 21 23:42:10 2005
@@ -70,7 +70,7 @@
             QName operationName = null;
             if (index > 0) {
                 serviceName = new QName(serviceAndMethodStr.substring(0,
-                                index - 1));
+                                index ));
                 operationName = new QName(serviceAndMethodStr.substring(index
                                         + 1));
             } else {

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/providers/RawXMLProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/providers/RawXMLProvider.java?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/providers/RawXMLProvider.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/providers/RawXMLProvider.java
Mon Feb 21 23:42:10 2005
@@ -23,9 +23,11 @@
 import org.apache.axis.engine.Provider;
 import org.apache.axis.om.OMElement;
 import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
 import org.apache.axis.om.SOAPEnvelope;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.wsdl.WSDLService;
 
 import javax.xml.namespace.QName;
 import java.lang.reflect.Method;
@@ -144,18 +146,43 @@
                             parameters[0].getName())) {
                 OMElement methodElement =
                         msgContext.getEnvelope().getBody().getFirstElement();
-                OMElement parmeter = methodElement.getFirstElement();
-                Object[] parms = new Object[]{parmeter};
-
-                // invoke the WebService
-                OMElement result = (OMElement) method.invoke(obj,
-                        parms);
+                        
+                OMElement parmeter = null;        
+                SOAPEnvelope envelope = null;
                 MessageContext msgContext1 = new MessageContext(
                         msgContext.getGlobalContext().getRegistry(),
                         msgContext.getProperties(), msgContext.getSessionContext());
-                SOAPEnvelope envelope =
-                        OMFactory.newInstance().getDefaultEnvelope();
-                envelope.getBody().setFirstChild(result);
+                        
+                if(WSDLService.STYLE_DOC.equals(msgContext.getMessageStyle())){
+                    parmeter = methodElement;
+                    Object[] parms = new Object[]{parmeter};
+
+                    // invoke the WebService
+                    OMElement result = (OMElement) method.invoke(obj,
+                            parms);
+                    envelope =
+                            OMFactory.newInstance().getDefaultEnvelope();
+                    envelope.getBody().setFirstChild(result);
+                
+                }else if(WSDLService.STYLE_RPC.equals(msgContext.getMessageStyle())){
+                    parmeter = methodElement.getFirstElement();
+                    Object[] parms = new Object[]{parmeter};
+
+                    // invoke the WebService
+                    OMElement result = (OMElement) method.invoke(obj,
+                            parms);
+                    OMFactory fac = OMFactory.newInstance();       
+                    envelope =
+                            OMFactory.newInstance().getDefaultEnvelope();
+
+                    OMNamespace ns = fac.createOMNamespace("http://soapenc/", "res");
+                     OMElement responseMethodName =
+                             fac.createOMElement(methodName + "Response", ns);
+                    responseMethodName.addChild(result);
+                    envelope.getBody().addChild(responseMethodName);                    
       
+                }else{
+                    throw new AxisFault("Unknown style ");
+                }
                 msgContext1.setEnvelope(envelope);
                 return msgContext1;
             } else {

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/HTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/HTTPTransportSender.java?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/HTTPTransportSender.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/HTTPTransportSender.java
Mon Feb 21 23:42:10 2005
@@ -114,7 +114,9 @@
     protected void finalizeSending(MessageContext msgContext,Writer writer)
             throws AxisFault {
         try {
-            socket.shutdownOutput();
+            if(socket != null){
+                socket.shutdownOutput();
+            }
         } catch (IOException e) {
             throw new AxisFault(e.getMessage(),e);
         }

Modified: webservices/axis/trunk/java/modules/samples/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/maven.xml?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/samples/maven.xml (original)
+++ webservices/axis/trunk/java/modules/samples/maven.xml Mon Feb 21 23:42:10 2005
@@ -57,7 +57,7 @@
 				<include name="interop/doclit/**/*.class"/>
 			</fileset>
 		</copy>
-		<copy file="src/java/interop/doclit/service.xml" tofile="target/jar-code/sample3/META-INF/service.xml"/>

+		<copy file="src/java/interop/doclit/service.xml" tofile="target/jar-code/sample4/META-INF/service.xml"/>

 		<jar jarfile="target/test-resources/samples/services/interop-doclit.jar" basedir="target/jar-code/sample4"
>
 			<include name="**" />
 		</jar>

Modified: webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/InteropProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/InteropProvider.java?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/InteropProvider.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/InteropProvider.java
Mon Feb 21 23:42:10 2005
@@ -23,12 +23,14 @@
 import org.apache.axis.om.OMElement;
 import org.apache.axis.om.OMFactory;
 import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.SOAPBody;
 import org.apache.axis.om.SOAPEnvelope;
 import org.apache.axis.testUtils.Encoder;
 import org.apache.axis.testUtils.ObjectToOMBuilder;
 import org.apache.axis.testUtils.SimpleJavaProvider;
 import org.apache.axis.testUtils.SimpleTypeEncoder;
 import org.apache.axis.testUtils.SimpleTypeEncodingUtils;
+import org.apache.wsdl.WSDLService;
 
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamReader;
@@ -44,44 +46,54 @@
 
     public Object[] deserializeParameters(MessageContext msgContext, Method method)
         throws AxisFault {
-        XMLStreamReader xpp = msgContext.getSoapOperationElement().getPullParser(true);
-        Class[] parms = method.getParameterTypes();
-        Object[] objs = new Object[parms.length];
+            try {
+            if(WSDLService.STYLE_DOC.equals(msgContext.getMessageStyle())){
+                SOAPBody body = msgContext.getEnvelope().getBody();
+                XMLStreamReader xpp = body.getPullParser(true);
+                Class[] parms = method.getParameterTypes();
+                Object[] objs = new Object[parms.length];
 
-        try {
-            int event = xpp.next();
-            while (XMLStreamConstants.START_ELEMENT != event
-                && XMLStreamConstants.END_ELEMENT != event) {
-                event = xpp.next();
-            }
-            //now we are at the opearion element event
-            event = xpp.next();
-            while (XMLStreamConstants.START_ELEMENT != event
-                && XMLStreamConstants.END_ELEMENT != event) {
-                event = xpp.next();
-            }
-            //now we are at the parameter element event
 
-            if (XMLStreamConstants.END_ELEMENT == event) {
-                return null;
-            } else {
-                for (int i = 0; i < parms.length; i++) {
-                    if (int.class.equals(parms[i])) {
-                        objs[i] = new Integer(SimpleTypeEncodingUtils.deserializeInt(xpp));
-                    } else if (String.class.equals(parms[i])) {
-                        objs[i] = SimpleTypeEncodingUtils.deserializeString(xpp);
-                    } else if (String[].class.equals(parms[i])) {
-                        objs[i] = SimpleTypeEncodingUtils.deserializeStringArray(xpp);
-                    } else if (SOAPStruct.class.equals(parms[i])) {
-                        SOAPStructEncoder enc = new SOAPStructEncoder();
-                        objs[i] = enc.deSerialize(xpp);
-                    }  else {
-                        throw new UnsupportedOperationException("UnSupported type "+parms[i]);
+                    int event = xpp.next();
+                    while (XMLStreamConstants.START_ELEMENT != event
+                        && XMLStreamConstants.END_ELEMENT != event) {
+                        event = xpp.next();
                     }
-                }
-                return objs;
+                    
+                    event = xpp.next();
+                    while (XMLStreamConstants.START_ELEMENT != event
+                        && XMLStreamConstants.END_ELEMENT != event) {
+                        event = xpp.next();
+                    }
+                //now we are at the parameters element event
 
-            }
+                    if (XMLStreamConstants.END_ELEMENT == event) {
+                        return null;
+                    } else {
+                        for (int i = 0; i < parms.length; i++) {
+                            if (int.class.equals(parms[i])) {
+                                objs[i] = new Integer(SimpleTypeEncodingUtils.deserializeInt(xpp));
+                            } else if (String.class.equals(parms[i])) {
+                                objs[i] = SimpleTypeEncodingUtils.deserializeString(xpp);
+                            } else if (String[].class.equals(parms[i])) {
+                                objs[i] = SimpleTypeEncodingUtils.deserializeStringArray(xpp);
+                            } else if (SOAPStruct.class.equals(parms[i])) {
+                                SOAPStructEncoder enc = new SOAPStructEncoder();
+                                objs[i] = enc.deSerialize(xpp);
+                            }  else {
+                                throw new UnsupportedOperationException("UnSupported type
"+parms[i]);
+                            }
+                        }
+                        return objs;
+
+                    }
+                
+            }else{
+                throw new AxisFault("this Service only supports doc-lit");
+            }
+            
+            
+            
         } catch (Exception e) {
             throw new AxisFault("Exception", e);
         }
@@ -131,12 +143,10 @@
             OMFactory fac = OMFactory.newInstance();
             SOAPEnvelope responseEnvelope = fac.getDefaultEnvelope();
 
-            OMNamespace ns = fac.createOMNamespace("http://soapinterop.org/WSDLInteropTestDocLit",
"res");
-            OMElement responseMethodName = fac.createOMElement(methodName + "Response", ns);
-            responseEnvelope.getBody().addChild(responseMethodName);
+            OMNamespace ns = fac.createOMNamespace("http://soapinterop.org/xsd", "res");
+            OMElement returnelement = fac.createOMElement("echoStringReturn", ns);
+            responseEnvelope.getBody().addChild(returnelement);
             if(result != null){
-                OMElement returnelement = fac.createOMElement(methodName + "Return", ns);
-                responseMethodName.addChild(returnelement);
                 returnelement.setBuilder(new ObjectToOMBuilder(returnelement, outobj));
                 returnelement.declareNamespace(OMConstants.ARRAY_ITEM_NSURI, "arrays");
                 returnelement.declareNamespace("http://soapinterop.org/WSDLInteropTestDocLit",
"s");

Modified: webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/service.xml?view=diff&r1=154817&r2=154818
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/service.xml (original)
+++ webservices/axis/trunk/java/modules/samples/src/java/interop/doclit/service.xml Mon Feb
21 23:42:10 2005
@@ -1,4 +1,4 @@
-<service provider="interop.doclit..InteropProvider" style="doc" contextPath="services">
+<service provider="interop.doclit.InteropProvider" style="doc" contextPath="services">
     <java:implementation class="interop.doclit.WSDLInteropTestDocLitPortType" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
     <operation name="echoString"/>
     <operation name="echoStringArray"/>



Mime
View raw message