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 2005/04/11 05:09:11 UTC
svn commit: r160824 - in
webservices/axis/trunk/java/modules/core/src/org/apache/axis/client: ./
AsyncResult.java Call.java Callback.java
Author: deepal
Date: Sun Apr 10 20:09:09 2005
New Revision: 160824
URL: http://svn.apache.org/viewcvs?view=rev&rev=160824
Log:
This include the new client API ,but the name will be renamed into Client API soon , after context and all finalize
Added:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/
webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/AsyncResult.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Callback.java
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/AsyncResult.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/AsyncResult.java?view=auto&rev=160824
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/AsyncResult.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/AsyncResult.java Sun Apr 10 20:09:09 2005
@@ -0,0 +1,30 @@
+package org.apache.axis.client;
+
+import org.apache.axis.om.SOAPEnvelope;
+
+/**
+ * Created by IntelliJ IDEA.
+ * Author : Deepal Jayasinghe
+ * Date: Apr 9, 2005
+ * Time: 8:04:36 PM
+ */
+public class AsyncResult {
+ /**
+ *Field result
+ */
+ private SOAPEnvelope result;
+
+ /**
+ * @param result
+ */
+ public void setResult(SOAPEnvelope result) {
+ this.result = result;
+ }
+
+ /**
+ * @return SOAPEnvelope
+ */
+ public SOAPEnvelope getResponseEnvelope() {
+ return result;
+ }
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java?view=auto&rev=160824
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java Sun Apr 10 20:09:09 2005
@@ -0,0 +1,144 @@
+package org.apache.axis.client;
+
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.context.EngineContext;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.Constants;
+
+import java.util.HashMap;
+import java.io.InputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * Author : Deepal Jayasinghe
+ * Date: Apr 9, 2005
+ * Time: 8:00:08 PM
+ */
+public class Call {
+
+ private EndpointReference to;
+ private EndpointReference from;
+ private EndpointReference replyTo;
+ private EndpointReference [] relatesTo;
+
+ private HashMap properties;
+
+ private String transport;
+
+ private String SOAPAction;
+
+ private EngineContext engineContext;
+
+ public Call(){
+ //find the deployment mechanism , create
+ //a EngineContext .. if the conf file not found
+ //deafult one is used
+ properties = new HashMap();
+ this.engineContext = new EngineContext();
+ }
+
+ public Call(InputStream in){
+ properties = new HashMap();
+ this.engineContext = new EngineContext();
+ }
+
+ public Call(File inFile) throws AxisFault {
+ try {
+ InputStream in =new FileInputStream(inFile);
+ properties = new HashMap();
+ this.engineContext = new EngineContext();
+ } catch (FileNotFoundException e) {
+ throw new AxisFault("FileNotFound " + e.getMessage());
+ }
+ }
+
+ public Call(EngineContext engineContext){
+ this.properties =new HashMap();
+ this.engineContext = engineContext;
+ }
+
+ public SOAPEnvelope sendReciveAsync(SOAPEnvelope env,Callback callback) throws AxisFault {
+ MessageContext msgctx = new MessageContext(null); //TODO try to pass old message context
+ //todo to complete this MessageContext has to be complete
+ return null;
+ }
+
+ public SOAPEnvelope sendReciveSync(SOAPEnvelope env) throws AxisFault {
+ MessageContext msgctx = new MessageContext(null); //TODO try to pass old message context
+ //todo to complete this MessageContext has to be complete
+ return null;
+
+ }
+
+ public EndpointReference getTo() {
+ return to;
+ }
+
+ public void setTo(EndpointReference to) {
+ this.to = to;
+ }
+
+ public EndpointReference getFrom() {
+ return from;
+ }
+
+ public void setFrom(EndpointReference from) {
+ this.from = from;
+ }
+
+ public EndpointReference getReplyTo() {
+ return replyTo;
+ }
+
+ public void setReplyTo(EndpointReference replyTo) {
+ this.replyTo = replyTo;
+ }
+
+ public EndpointReference[] getRelatesTo() {
+ return relatesTo;
+ }
+
+ public void setRelatesTo(EndpointReference[] relatesTo) {
+ this.relatesTo = relatesTo;
+ }
+
+ public String getTransport() {
+ return transport;
+ }
+
+ public void setTransport(String transport) throws AxisFault {
+ if ((Constants.TRANSPORT_HTTP.equals(transport)
+ || Constants.TRANSPORT_MAIL.equals(transport)
+ || Constants.TRANSPORT_TCP.equals(transport))) {
+ this.transport = transport;
+ } else {
+ throw new AxisFault("Selected transport dose not suppot ( " + transport + " )");
+ }
+ }
+
+ public String getSOAPAction() {
+ return SOAPAction;
+ }
+
+ public void setSOAPAction(String SOAPAction) throws AxisFault {
+ if(SOAPAction.trim() == ""){
+ throw new AxisFault("SOAP action can not be an empty value");
+ } else {
+ this.SOAPAction = SOAPAction;
+ }
+ }
+
+ public void addProperty(String key , Object value){
+ properties.put(key,value);
+ }
+
+ public Object getProperty(String key){
+ return properties.get(key);
+ }
+
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Callback.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Callback.java?view=auto&rev=160824
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Callback.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Callback.java Sun Apr 10 20:09:09 2005
@@ -0,0 +1,69 @@
+package org.apache.axis.client;
+
+/**
+ * Created by IntelliJ IDEA.
+ * Author : Deepal Jayasinghe
+ * Date: Apr 9, 2005
+ * Time: 8:03:41 PM
+ */
+public abstract class Callback {
+ /**
+ * Field complete
+ */
+ private boolean complete = false;
+
+ /**
+ * Field result
+ */
+ private AsyncResult result;
+
+ /**
+ * Method onComplete
+ *
+ * @param result
+ */
+ public abstract void onComplete(AsyncResult result);
+
+ /**
+ * Method reportError
+ *
+ * @param e
+ */
+ public abstract void reportError(Exception e);
+
+ /**
+ * Method isComplete
+ *
+ * @return
+ */
+ public boolean isComplete() {
+ return complete;
+ }
+
+ /**
+ * Method setComplete
+ *
+ * @param complete
+ */
+ public void setComplete(boolean complete) {
+ this.complete = complete;
+ }
+
+ /**
+ * Method getResult
+ *
+ * @return
+ */
+ public AsyncResult getResult() {
+ return result;
+ }
+
+ /**
+ * Method setResult
+ *
+ * @param result
+ */
+ public void setResult(AsyncResult result) {
+ this.result = result;
+ }
+}