axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r225491 - in /webservices/axis/trunk/java/modules: samples/ samples/src/org/apache/axis2/soap12testing/client/ tool/src/org/apache/axis2/tool/codegen/eclipse/
Date Wed, 27 Jul 2005 11:36:22 GMT
Author: deepal
Date: Wed Jul 27 04:35:45 2005
New Revision: 225491

URL: http://svn.apache.org/viewcvs?rev=225491&view=rev
Log:
fixing SOAP testing problem .

Modified:
    webservices/axis/trunk/java/modules/samples/project.xml
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
    webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
    webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=225491&r1=225490&r2=225491&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Wed Jul 27 04:35:45 2005
@@ -168,8 +168,8 @@
                 <exclude>**org/apache/axis2/mail/*.java</exclude>
 
                 <!--Deepal SOAP test suit is failing due to some problem in AxisEngine
some one has to fix that-->
-                <exclude>**/*SOAP12Test.java</exclude>
-                <exclude>**/*SOAP12TestWithFaults.java</exclude>
+<!--                <exclude>**/*SOAP12Test.java</exclude>-->
+<!--                <exclude>**/*SOAP12TestWithFaults.java</exclude>-->
 
                 <!--		<exclude>**/*MailEchoRawXMLTest.java</exclude>
                 <exclude>**/*MailOneWayRawXMLTest.java</exclude>

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java?rev=225491&r1=225490&r2=225491&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/MessageComparator.java
Wed Jul 27 04:35:45 2005
@@ -20,18 +20,29 @@
 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.om.OMXMLParserWrapper;
 import org.apache.axis2.om.impl.llom.exception.XMLComparisonException;
+import org.apache.axis2.transport.http.HTTPTransportReceiver;
+import org.apache.axis2.engine.AxisFault;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamException;
 import java.io.*;
+import java.util.Map;
 
 public class MessageComparator {
     public boolean compare(String testNumber, InputStream replyMessage) {
         SOAPEnvelope replyMessageEnvelope;
         SOAPEnvelope requiredMessageEnvelope;
         try {
+//            File file = new File("D:\\Projects\\LSF\\Axis2\\Axis1.0\\modules\\samples/test-resources\\SOAP12Testing\\ReplyMessages\\SOAP12ResT"
+ testNumber + ".xml");
             File file = new File("test-resources\\SOAP12Testing\\ReplyMessages\\SOAP12ResT"
+ testNumber + ".xml");
+
+            HTTPTransportReceiver receiver = new HTTPTransportReceiver();
+            Map map = receiver.parseTheHeaders(replyMessage, false);
+
+
+
+
             XMLStreamReader requiredMessageParser = XMLInputFactory.newInstance().createXMLStreamReader(new
FileReader(file));
             OMXMLParserWrapper requiredMessageBuilder = new StAXSOAPModelBuilder(requiredMessageParser,null);
             requiredMessageEnvelope = (SOAPEnvelope) requiredMessageBuilder.getDocumentElement();
@@ -49,6 +60,8 @@
             e.printStackTrace();
         } catch (XMLComparisonException e) {
             e.printStackTrace();
+        } catch (AxisFault axisFault) {
+            axisFault.printStackTrace();
         }
         return false;
     }

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java?rev=225491&r1=225490&r2=225491&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAP12TestClient.java
Wed Jul 27 04:35:45 2005
@@ -16,30 +16,36 @@
 
 package org.apache.axis2.soap12testing.client;
 
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.transport.http.HTTPConstants;
+
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.*;
 import java.io.*;
 import java.util.Iterator;
 
-public class SOAP12TestClient {            
+public class SOAP12TestClient {
     public String getReply(int port, String webserviceName,String testNumber) {
         String replyMessage = "";
         try {
             URL netUrl = new URL("http://localhost:"+port+"/axis2/services/"+webserviceName+"/echo");
-            HttpURLConnection connection = (HttpURLConnection) netUrl.openConnection();
-            connection.setDoOutput(true);
+
+            Socket socket =  new Socket("127.0.0.1",port);
+
+//            HttpURLConnection connection = (HttpURLConnection) netUrl.openConnection();
+//            connection.setDoOutput(true);
 
             SOAPCreater soapCreater = new SOAPCreater();
-            String requestMessage = soapCreater.getStringFromSOAPMessage(testNumber);
+            String requestMessage = soapCreater.getStringFromSOAPMessage(testNumber,netUrl);
             PrintWriter out = new PrintWriter(
-                              connection.getOutputStream());
-
+                    socket.getOutputStream());
+//                              connection.getOutputStream());
             out.println(requestMessage);
             out.flush();
-	        out.close();
+            out.close();
 
-            BufferedReader reader = new BufferedReader( new InputStreamReader(connection.getInputStream()));
+            BufferedReader reader = new BufferedReader( new InputStreamReader(socket.getInputStream()));
             StringBuffer sb = new StringBuffer();
             String response = reader.readLine();
             while( null != response ) {
@@ -47,7 +53,8 @@
                 response = reader.readLine();
             }
             replyMessage = sb.toString();
-            connection.disconnect();
+            socket.close();
+//            connection.disconnect();
 
         } catch (MalformedURLException e) {
             e.printStackTrace();
@@ -60,16 +67,15 @@
     public InputStream getRelpy(int port,String webserviceName,String testNumber) {
         try {
             URL netUrl = new URL("http://localhost:"+port+"/axis2/services/"+webserviceName+"/echo");
-            HttpURLConnection connection = (HttpURLConnection) netUrl.openConnection();
-            connection.setDoOutput(true);
-
+            Socket socket =  new Socket("127.0.0.1",port);
             SOAPCreater soapCreater = new SOAPCreater();
-            String requestMessage = soapCreater.getStringFromSOAPMessage(testNumber);
-            PrintWriter out = new PrintWriter(connection.getOutputStream());
+            String requestMessage = soapCreater.getStringFromSOAPMessage(testNumber,netUrl);
+            PrintWriter out = new PrintWriter(
+                    socket.getOutputStream());
+            System.out.println("Message: " + requestMessage);
             out.println(requestMessage);
             out.flush();
-	        out.close();
-            return connection.getInputStream();
+            return socket.getInputStream();
         } catch (MalformedURLException e) {
             e.printStackTrace();
         } catch (IOException e) {

Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java?rev=225491&r1=225490&r2=225491&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis2/soap12testing/client/SOAPCreater.java
Wed Jul 27 04:35:45 2005
@@ -18,15 +18,20 @@
 
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis2.om.OMXMLParserWrapper;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.engine.AxisFault;
 
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLInputFactory;
 import java.io.*;
+import java.net.URL;
 
 public class SOAPCreater {
-    public String getStringFromSOAPMessage(String testNumber) {
-         //D:\Projects\LSF\Axis2\Axis1.0\modules\samples\target\Repository
+    public String getStringFromSOAPMessage(String testNumber , URL url) {
+        //D:\Projects\LSF\Axis2\Axis1.0\modules\samples\target\Repository
 //        File file = new File("D:\\Projects\\LSF\\Axis2\\Axis1.0\\modules\\samples/test-resources\\SOAP12Testing\\RequestMessages\\SOAP12ReqT"
+ testNumber + ".xml");
         File file = new File("./test-resources\\SOAP12Testing\\RequestMessages\\SOAP12ReqT"
+ testNumber + ".xml");
         try {
@@ -34,11 +39,19 @@
             BufferedInputStream bf = new BufferedInputStream(stream);
             DataInputStream ds = new DataInputStream(bf);
             StringBuffer sb = new StringBuffer();
+
+            sb.append(HTTPConstants.HEADER_POST).append(" ");
+            sb.append(url.getFile()).append(" ").append(HTTPConstants.HEADER_PROTOCOL_10).append(
+                    "\n");
+            sb.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ")
+                    .append(SOAP12Constants.SOAP_12_CONTENT_TYPE);
+            sb.append("; charset=utf-8\n");
+            sb.append("\n");
+
             String record;
             while ((record = ds.readLine()) != null) {
                 sb.append(record.trim());
             }
-            System.out.println("record = " + sb.toString());
             return sb.toString();
         } catch (Exception e) {
             return "";

Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java?rev=225491&r1=225490&r2=225491&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
(original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
Wed Jul 27 04:35:45 2005
@@ -8,6 +8,8 @@
 import org.apache.axis.wsdl.codegen.CodeGenConfiguration;
 import org.apache.axis.wsdl.codegen.CodeGenerationEngine;
 import org.apache.wsdl.WSDLDescription;
+import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
+import org.apache.axis2.wsdl.codegen.CodeGenerationEngine;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jface.dialogs.MessageDialog;



Mime
View raw message