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 de...@apache.org on 2004/12/28 10:52:01 UTC
svn commit: r123487 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/clientapi test/org/apache/axis test/org/apache/axis/clientapi test/org/apache/axis/encoding
Author: deepal
Date: Tue Dec 28 01:52:00 2004
New Revision: 123487
URL: http://svn.apache.org/viewcvs?view=rev&rev=123487
Log:
fixing the bug , sendReciveAsyn
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java?view=diff&rev=123487&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java&r1=123486&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java&r2=123487
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Call.java Tue Dec 28 01:52:00 2004
@@ -171,7 +171,7 @@
*/
public void sendReceiveAsync(SOAPEnvelope envelope, final Callback callback) throws AxisFault {
try{
- URL url =new URL(targetEPR.getAddress());
+ // URL url =new URL(targetEPR.getAddress());
AxisEngine engine = new AxisEngine(registry);
final MessageContext msgctx = new MessageContext(registry);
msgctx.setEnvelope(envelope);
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java?view=diff&rev=123487&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java&r1=123486&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java&r2=123487
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/clientapi/Invoker.java Tue Dec 28 01:52:00 2004
@@ -37,8 +37,8 @@
final Correlator correlator = Correlator.getInstance();
final String messageID = Long.toString(System.currentTimeMillis());
try {
- final URL url = new URL(reqMsgContext.getTo().getAddress());
- final URLConnection urlConnect = url.openConnection();
+ URL url = new URL(reqMsgContext.getTo().getAddress());
+ URLConnection urlConnect = url.openConnection();
urlConnect.setDoOutput(true);
OutputStream out = urlConnect.getOutputStream();
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java?view=diff&rev=123487&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java&r1=123486&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java&r2=123487
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java Tue Dec 28 01:52:00 2004
@@ -54,7 +54,7 @@
tempDir = new File(basedir,tempDir).getAbsolutePath();
}
-
+
public File getTestResourceFile(String relativePath){
return new File(testResourceDir,relativePath);
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java?view=diff&rev=123487&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java&r1=123486&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java&r2=123487
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java Tue Dec 28 01:52:00 2004
@@ -17,6 +17,7 @@
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
import org.apache.axis.AbstractTestCase;
import org.apache.axis.addressing.AddressingConstants;
@@ -31,6 +32,7 @@
import org.apache.axis.impl.description.ParameterImpl;
import org.apache.axis.impl.description.SimpleAxisOperationImpl;
import org.apache.axis.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.axis.impl.llom.builder.StAXSOAPModelBuilder;
import org.apache.axis.impl.providers.RawXMLProvider;
import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
import org.apache.axis.om.OMFactory;
@@ -86,7 +88,7 @@
}
public void testSendReceive() throws Exception {
-
+
SOAPEnvelope envelope = getBasicEnvelope();
EndpointReference targetEPR = new EndpointReference(
AddressingConstants.WSA_TO,"http://127.0.0.1:"+EngineUtils.TESTING_PORT+"/axis/services/EchoXMLService");
@@ -98,13 +100,12 @@
}
+
private SOAPEnvelope getBasicEnvelope() throws Exception {
- File file = new File("./target/test-classes/clientapi/SimpleSOAPEnvelope.xml");
- XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(file)); //put the file
- OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFactory
- .newInstance(), xmlStreamReader);
- return (SOAPEnvelope) builder.getDocumentElement();
+ SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(
+ new FileReader(getTestResourceFile("clientapi/SimpleSOAPEnvelope.xml")))).getSOAPEnvelope();
+ return envelope;
}
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java?view=diff&rev=123487&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java&r1=123486&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java&r2=123487
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java Tue Dec 28 01:52:00 2004
@@ -6,34 +6,29 @@
*/
package org.apache.axis.clientapi;
-import java.io.File;
-import java.io.FileReader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
import org.apache.axis.AbstractTestCase;
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.AxisOperation;
-import org.apache.axis.encoding.EncodingTest.Echo;
import org.apache.axis.engine.EngineRegistry;
import org.apache.axis.engine.EngineUtils;
+import org.apache.axis.engine.Echo;
import org.apache.axis.impl.description.AxisService;
import org.apache.axis.impl.description.SimpleAxisOperationImpl;
-import org.apache.axis.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.axis.impl.llom.builder.StAXSOAPModelBuilder;
import org.apache.axis.impl.providers.RawXMLProvider;
import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
-import org.apache.axis.om.OMFactory;
-import org.apache.axis.om.OMXMLParserWrapper;
import org.apache.axis.om.SOAPEnvelope;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import java.io.FileReader;
+
/**
* @author Jaliya
*
@@ -45,11 +40,9 @@
private QName serviceName = new QName("", "EchoXMLService");
- private QName operationName = new QName("http://localhost/my",
- "echoOMElement");
+ private QName operationName = new QName("http://localhost/my", "echoOMElement");
- private QName transportName = new QName("http://localhost/my",
- "NullTransport");
+ private QName transportName = new QName("http://localhost/my", "NullTransport");
private EngineRegistry engineRegistry;
@@ -70,13 +63,13 @@
}
- protected void setUp() throws Exception {
- engineRegistry = EngineUtils.createMockRegistry(serviceName,
- operationName, transportName);
+ protected void setUp() throws Exception {
+ engineRegistry = EngineUtils.createMockRegistry(serviceName, operationName, transportName);
AxisService service = new AxisService(serviceName);
service.setClassLoader(Thread.currentThread().getContextClassLoader());
- service.setServiceClass(Echo.class); service.setProvider(new RawXMLProvider());
+ service.setServiceClass(Echo.class);
+ service.setProvider(new RawXMLProvider());
AxisOperation operation = new SimpleAxisOperationImpl(operationName);
service.addOperation(operation);
@@ -100,7 +93,7 @@
public void testSendReceiveAsync() throws Exception{
- SOAPEnvelope envelope=getBasicEnvelope();
+ SOAPEnvelope envelope = getBasicEnvelope();
EndpointReference targetEPR = new EndpointReference(
AddressingConstants.WSA_TO,"http://127.0.0.1:"+EngineUtils.TESTING_PORT+"/axis/services/EchoXMLService");
Call call = new Call();
@@ -122,22 +115,25 @@
}
}
public void reportError(Exception e){
- e.printStackTrace();
+ e.printStackTrace();
}
};
-
call.sendReceiveAsync(envelope,callback);
}
+ private SOAPEnvelope getBasicEnvelope() throws Exception {
+
+ SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(
+ new FileReader(getTestResourceFile("clientapi/SimpleSOAPEnvelope.xml")))).getSOAPEnvelope();
+
+ /* File file = new File("./target/test-classes/clientapi/SimpleSOAPEnvelope.xml");
+ XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(file)); //put the file
+
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFactory
+ .newInstance(), xmlStreamReader);
+ return (SOAPEnvelope) builder.getDocumentElement(); */
+ return envelope;
+ }
+
- private SOAPEnvelope getBasicEnvelope() throws Exception{
- File file = new File("./target/test-classes/clientapi/SimpleSOAPEnvelope.xml");
- XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance()
- .createXMLStreamReader(new FileReader(file)); //put the file
-
- OMXMLParserWrapper builder = OMXMLBuilderFactory
- .createStAXSOAPModelBuilder(OMFactory.newInstance(),
- xmlStreamReader);
- return (SOAPEnvelope) builder.getDocumentElement();
- }
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java?view=diff&rev=123487&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java&r1=123486&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java&r2=123487
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java Tue Dec 28 01:52:00 2004
@@ -32,14 +32,14 @@
public class EncodingTest extends AbstractTestCase {
+
/**
* @param testName
*/
public EncodingTest(String testName) {
super(testName);
}
-
-
+
public void testDeserializingInt() throws SecurityException, NoSuchMethodException, AxisFault{
Method method = Echo.class.getMethod("echoInt",new Class[]{int.class});
OMNamespace omNs = OMFactory.newInstance().createOMNamespace("http://host/my","my");
@@ -100,7 +100,7 @@
}
- public class Echo{
+ public class Echo{
public int echoInt(int intVal){
return intVal;
}