You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/08/31 13:51:45 UTC

svn commit: r265023 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/clientapi/ integration/test/org/apache/axis2/engine/ samples/resources/om/binary/ samples/src/sample/om/binary/ xml/src/org/apache/axis2/om/impl/llom/ xml/test/or...

Author: chinthaka
Date: Wed Aug 31 04:51:12 2005
New Revision: 265023

URL: http://svn.apache.org/viewcvs?rev=265023&view=rev
Log:
- adding convenience method to call api to get SOAP envelope as the input
- struggling a bit again with FI

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Call.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java
    webservices/axis2/trunk/java/modules/samples/resources/om/binary/binary.xml
    webservices/axis2/trunk/java/modules/samples/src/sample/om/binary/FIUtil.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java
    webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/AbstractOMSerializationTest.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Call.java?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Call.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Call.java Wed Aug 31 04:51:12 2005
@@ -33,7 +33,8 @@
 import java.util.HashMap;
 
 /**
- * This class is the pretty convineance class for the user without see the comlplexites of Axis2.
+ * This class should be used only to invoke INOUT web services and will serve as a more convenient
+ * class to work with INOUT MEP.
  */
 public class Call extends InOutMEPClient {
 
@@ -42,8 +43,6 @@
     private MessageContext lastResponseMessage;
 
     /**
-     * this is a convenience Class, here the Call will assume a Annoynmous Service.
-     *
      * @throws AxisFault
      */
 
@@ -73,7 +72,7 @@
     /**
      * Invoke the blocking/Synchronous call
      *
-     * @param axisop
+     * @param axisop - this will be used to identify the operation in the client side, without dispatching
      * @param toSend - This should be OM Element (payload)
      * @return
      * @throws AxisFault
@@ -93,6 +92,28 @@
     }
 
     /**
+     * Invoke the blocking/Synchronous call
+     *
+     * @param axisop - this will be used to identify the operation in the client side, without dispatching
+     * @param toSend - This should be SOAPEnvelope
+     * @return
+     * @throws AxisFault
+     */
+    public SOAPEnvelope invokeBlocking(String axisop, SOAPEnvelope envelope)
+            throws AxisFault {
+
+        OperationDescription opDesc =
+                serviceContext.getServiceConfig().getOperation(new QName(axisop));
+        opDesc = createOpDescAndFillInFlowInformation(opDesc,axisop);
+
+        MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());
+        msgctx.setEnvelope(envelope);
+
+        this.lastResponseMessage = super.invokeBlocking(opDesc, msgctx);
+        return lastResponseMessage.getEnvelope();
+    }
+
+    /**
      * Invoke the nonblocking/Asynchronous call
      *
      * @param axisop
@@ -111,6 +132,30 @@
                 serviceContext.getServiceConfig().getOperation(new QName(axisop));
         opDesc = createOpDescAndFillInFlowInformation(opDesc,axisop);
         MessageContext msgctx = prepareTheSOAPEnvelope(toSend);
+        //call the underline implementation
+        super.invokeNonBlocking(opDesc, msgctx, callback);
+    }
+/**
+     * Invoke the nonblocking/Asynchronous call
+     *
+     * @param axisop
+     * @param envelope   -  This should be a SOAP Envelope 
+     *                 invocation behaves accordingly
+     * @param callback
+     * @throws org.apache.axis2.AxisFault
+     */
+
+    public void invokeNonBlocking(
+            String axisop,
+            SOAPEnvelope envelope,
+            Callback callback)
+            throws AxisFault {
+        OperationDescription opDesc =
+                serviceContext.getServiceConfig().getOperation(new QName(axisop));
+        opDesc = createOpDescAndFillInFlowInformation(opDesc,axisop);
+
+        MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());
+        msgctx.setEnvelope(envelope);
         //call the underline implementation
         super.invokeNonBlocking(opDesc, msgctx, callback);
     }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java Wed Aug 31 04:51:12 2005
@@ -232,8 +232,6 @@
                 msgctx.setOperationContext(axisop.findOperationContext(msgctx, serviceContext));
                 msgctx.setServiceContext(serviceContext);
 
-                System.out.println("Reply To = " + msgctx.getReplyTo().getAddress());
-                System.out.println("To = " + msgctx.getTo().getAddress());
                 //send the message
                 engine.send(msgctx);
             } else {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLTest.java Wed Aug 31 04:51:12 2005
@@ -23,6 +23,7 @@
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.clientapi.AsyncResult;
+import org.apache.axis2.clientapi.Call;
 import org.apache.axis2.clientapi.Callback;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceContext;
@@ -151,8 +152,8 @@
 
         OMElement payload = TestingUtils.createDummyOMElement();
 
-        org.apache.axis2.clientapi.Call call =
-                new org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
+        Call call =
+                new Call("target/test-resources/intregrationRepo");
 
         call.setTo(targetEPR);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,

Modified: webservices/axis2/trunk/java/modules/samples/resources/om/binary/binary.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/resources/om/binary/binary.xml?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/resources/om/binary/binary.xml (original)
+++ webservices/axis2/trunk/java/modules/samples/resources/om/binary/binary.xml Wed Aug 31 04:51:12 2005
@@ -1,15 +1 @@
-<Project xmlns:apache="http://ws.apache.org/axis2">
-    <Name>Axis2</Name>
-    <CurrentVersion>0.9</CurrentVersion>
-    <Modules><!-- List of modules that can be found under Axis2 project -->
-        <Module name="xml">
-            <Description>XML Object Model</Description>
-        </Module>
-        <Module name="wsdl">
-            <Description>Full WSDL solution for Axis2</Description>
-        </Module>
-        <Module name="core">
-            <Description>Core parts of Axis2</Description>
-        </Module>
-    </Modules>
-</Project>
\ No newline at end of file
+<Project xmlns:apache="http://ws.apache.org/axis2"><Name>Axis2</Name><CurrentVersion>0.9</CurrentVersion><Modules><!-- List of modules that can be found under Axis2 project --><Module name="xml"><Description>XML Object Model</Description></Module><Module name="wsdl"><Description>Full WSDL solution for Axis2</Description></Module><Module name="core"><Description>Core parts of Axis2</Description></Module></Modules></Project>
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/om/binary/FIUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/om/binary/FIUtil.java?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/om/binary/FIUtil.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/om/binary/FIUtil.java Wed Aug 31 04:51:12 2005
@@ -77,11 +77,13 @@
             System.out.println("********** XML ==> OM **************");
             XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(inFileName));
             StAXOMBuilder omStAXOMBuilder = new StAXOMBuilder(xmlStreamReader);
+            omStAXOMBuilder.setDoDebug(true);
             System.out.println("StAXOMBuilder created from " + inFileName + " ........");
 
             System.out.println("********** OM ==> Binary **************");
             File binaryFile = getBinaryXML(inFileName);
             StAXDocumentSerializer binaryStAXSerializer = new StAXDocumentSerializer(new FileOutputStream(binaryFile));
+            omStAXOMBuilder.getDocumentElement().build();
             omStAXOMBuilder.getDocumentElement().serializeWithCache(binaryStAXSerializer);
 //            binaryStAXSerializer.flush();
             System.out.println("Created binary file " + binaryFile.getName() + " from OM ......");

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java Wed Aug 31 04:51:12 2005
@@ -28,8 +28,6 @@
 import javax.xml.stream.XMLStreamWriter;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Date;
-import java.util.Random;
 
 public class OMTextImpl extends OMNodeImpl implements OMText, OMConstants {
     protected String value = null;

Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/AbstractOMSerializationTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/AbstractOMSerializationTest.java?rev=265023&r1=265022&r2=265023&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/AbstractOMSerializationTest.java (original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/AbstractOMSerializationTest.java Wed Aug 31 04:51:12 2005
@@ -137,7 +137,7 @@
             throws ParserConfigurationException, SAXException, IOException {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
-        DocumentBuilder db = dbf.newDocumentBuilder();
+        DocumentBuilder db = dbf.newDocumentBuilder();   
         return db.parse(in);
     }