You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by he...@apache.org on 2005/04/14 18:39:23 UTC
svn commit: r161318 [1/2] - in webservices/axis/trunk/java: etc/
modules/core/src/org/apache/axis/ modules/core/src/org/apache/axis/clientapi/
modules/core/src/org/apache/axis/context/
modules/core/src/org/apache/axis/description/
modules/core/src/org/apache/axis/engine/
modules/core/src/org/apache/axis/phaseresolver/
modules/core/src/org/apache/axis/receivers/
modules/core/src/org/apache/axis/util/
modules/core/test/org/apache/axis/deployment/
modules/core/test/org/apache/axis/description/
modules/core/test/org/apache/axis/engine/
modules/samples/src/encoding/sample1/
modules/samples/src/encoding/sample2/benchMark/
modules/samples/src/interop/doclit/
modules/samples/src/org/apache/axis/testUtils/
modules/samples/src/userguide/sample1/
modules/samples/test/org/apache/axis/clientapi/
modules/samples/test/org/apache/axis/engine/
modules/samples/test/org/apache/axis/integration/
Author: hemapani
Date: Thu Apr 14 09:39:15 2005
New Revision: 161318
URL: http://svn.apache.org/viewcvs?view=rev&rev=161318
Log: (empty)
Added:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInMessageReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutAsyncMessageReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutSyncMessageReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractRobustInMessageReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/ServerCallback.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/AbstractEngineTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithDynamicPhaseResolvingTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
- copied, changed from r161064, webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/PhaseResolvingTest.java
Removed:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/InOutAsyncReceiver.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLProvider.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineUtils.java
Modified:
webservices/axis/trunk/java/etc/project.properties
webservices/axis/trunk/java/etc/project.xml
webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Callback.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/ServiceHandlersChainBuilder.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/RegistryTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/SpeakingProvider.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoProvider.java
webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoStub.java
webservices/axis/trunk/java/modules/samples/src/encoding/sample2/benchMark/BenchProvider.java
webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java
webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropStub.java
webservices/axis/trunk/java/modules/samples/src/org/apache/axis/testUtils/SimpleJavaProvider.java
webservices/axis/trunk/java/modules/samples/src/userguide/sample1/SynchronousClient.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CallUnregisteredServiceTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/EchoTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java
Modified: webservices/axis/trunk/java/etc/project.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/etc/project.properties?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/etc/project.properties (original)
+++ webservices/axis/trunk/java/etc/project.properties Thu Apr 14 09:39:15 2005
@@ -16,7 +16,7 @@
maven.repo.remote=http://www.apache.org/dist/java-repository/
maven.multiproject.includes=modules/*/project.xml
-maven.multiproject.excludes=modules/tool/project.xml
+maven.multiproject.excludes=modules/tool/project.xml,modules/samples/project.xml
maven.xdoc.date=left
## maven.xdoc.version=${pom.currentVersion}
Modified: webservices/axis/trunk/java/etc/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/etc/project.xml?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/etc/project.xml (original)
+++ webservices/axis/trunk/java/etc/project.xml Thu Apr 14 09:39:15 2005
@@ -155,6 +155,17 @@
<sourceDirectory>src</sourceDirectory>
<unitTestSourceDirectory>test</unitTestSourceDirectory>
+<!--
+ <sourceModifications>
+ <sourceModification>
+ <className>fakeClass</className>
+ <excludes>
+ <exclude>org/apache/axis</exclude>
+ <exclude>**/_*.java</exclude>
+ </excludes>
+ </sourceModification>
+ </sourceModifications
+-->
<unitTest>
<excludes>
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Thu Apr 14 09:39:15 2005
@@ -47,7 +47,7 @@
/**
* Field GLOBAL_SCOPE
*/
- public static final String GLOBAL_SCOPE = "global";
+ public static final String MESSAGE_SCOPE = "message";
/**
* Field PHASE_SERVICE
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Callback.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Callback.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Callback.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Callback.java Thu Apr 14 09:39:15 2005
@@ -24,7 +24,7 @@
*
* @param result
*/
- public abstract void onComplete(SOAPEnvelope result);
+ public abstract void onComplete(AsyncResult result);
/**
* Method reportError
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java Thu Apr 14 09:39:15 2005
@@ -64,6 +64,10 @@
serviceContextMap.put(service.getServiceConfig().getName(),service);
}
+ public void removeService(QName name){
+ serviceContextMap.remove(name);
+ }
+
public ServiceContext getService(QName serviceName){
return (ServiceContext)serviceContextMap.get(serviceName);
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java Thu Apr 14 09:39:15 2005
@@ -530,9 +530,7 @@
engineContext = context;
}
- public String getAction() {
- return messageInformationHeaders.getAction();
- }
+
/**
* @return
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java Thu Apr 14 09:39:15 2005
@@ -370,27 +370,27 @@
}
}
- /**
- * Method setServiceClass
- *
- * @param serviceclass
- */
- public void setServiceClass(Class serviceclass) {
- if (serviceclass != null) {
- this.setComponentProperty(DescriptionConstants.SERVICE_CLASS,
- serviceclass);
- }
- }
-
- /**
- * Method getServiceClass
- *
- * @return
- */
- public Class getServiceClass() {
- return (Class) this.getComponentProperty(
- DescriptionConstants.SERVICE_CLASS);
- }
+// /**
+// * Method setServiceClass
+// *
+// * @param serviceclass
+// */
+// public void setServiceClass(Class serviceclass) {
+// if (serviceclass != null) {
+// this.setComponentProperty(DescriptionConstants.SERVICE_CLASS,
+// serviceclass);
+// }
+// }
+//
+// /**
+// * Method getServiceClass
+// *
+// * @return
+// */
+// public Class getServiceClass() {
+// return (Class) this.getComponentProperty(
+// DescriptionConstants.SERVICE_CLASS);
+// }
/**
* Method getOperations
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java Thu Apr 14 09:39:15 2005
@@ -67,7 +67,7 @@
throw new AxisFault("Both the URI and SOAP_ACTION are Null");
}
if (msgctx.getOperationContext() == null) {
- String action = (String) msgctx.getProperty(MessageContext.SOAP_ACTION);
+ String action = (String) msgctx.getWSAAction();
QName operationName = new QName(action);
AxisOperation op = service.getOperation(operationName);
if (op != null) {
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java Thu Apr 14 09:39:15 2005
@@ -61,6 +61,13 @@
try {
ExecutionChain chain = context.getExecutionChain();
ServiceContext serviceContext = context.getServiceContext();
+
+ /*
+ * There is a two cases, at the server side(response) / client side
+ * but in the server side there must be a Service object object set, as before the
+ * out flow is started the user knows the services that will be invoked.
+ */
+
if (serviceContext != null) {
// what are we suppose to do in the client side
@@ -68,7 +75,7 @@
chain.addPhases(serviceContext.getPhases(EngineConfiguration.OUTFLOW));
} else {
if (context.isServerSide() && !context.isProcessingFault()) {
- throw new AxisFault("in Server Side there must be service object");
+ throw new AxisFault("At the Send there must be a Service Object set at the Server Side");
}
}
@@ -168,7 +175,7 @@
* @param e
* @throws AxisFault
*/
- private void handleFault(MessageContext context, Throwable e) throws AxisFault {
+ public void handleFault(MessageContext context, Throwable e) throws AxisFault {
boolean serverSide = context.isServerSide();
log.error("Error Ocurred", e);
if (serverSide && !context.isProcessingFault()) {
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/ServiceHandlersChainBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/ServiceHandlersChainBuilder.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/ServiceHandlersChainBuilder.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/ServiceHandlersChainBuilder.java Thu Apr 14 09:39:15 2005
@@ -64,8 +64,8 @@
module.engage(chain);
}
- } else {
- throw new AxisFault("Service " + serviceContext.getName() + " is not found");
+ } else if(msgContext.isServerSide()){
+ throw new AxisFault("Service Context is Null");
}
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java Thu Apr 14 09:39:15 2005
@@ -54,7 +54,8 @@
private ArrayList inPhases;
private ArrayList outPhases;
- private ArrayList faultPhases;
+ private ArrayList faultInPhases;
+ private ArrayList faultOutPhases;
private int flowType = -1;
@@ -94,7 +95,8 @@
private void fillFlowPhases() {
inPhases = new ArrayList();
outPhases = new ArrayList();
- faultPhases = new ArrayList();
+ faultInPhases = new ArrayList();
+ faultOutPhases = new ArrayList();
ArrayList tempPhases = registry.getInPhases();
for (int i = 0; i < tempPhases.size(); i++) {
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java Thu Apr 14 09:39:15 2005
@@ -26,7 +26,8 @@
public static final int IN_FLOW = 1;
public static final int OUT_FLOW = 2;
- public static final int FAULT_FLOW = 3;
+ public static final int FAULT_IN_FLOW = 3;
+ public static final int FAULT_OUT_FLOW = 4;
/**
* Field BOTH_BEFORE_AFTER
*/
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInMessageReceiver.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInMessageReceiver.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInMessageReceiver.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.receivers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This is takes care of the IN-OUT sync MEP in the server side
+ */
+public abstract class AbstractInMessageReceiver
+ extends AbstractMessageReceiver {
+ protected Log log = LogFactory.getLog(getClass());
+ public abstract void invokeBusinessLogic(MessageContext inMessage);
+
+ public final void recieve(final MessageContext messgeCtx) throws AxisFault {
+ invokeBusinessLogic(messgeCtx);
+ }
+
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutAsyncMessageReceiver.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutAsyncMessageReceiver.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutAsyncMessageReceiver.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.receivers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.MessageSender;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This is takes care of the IN-OUT sync MEP in the server side
+ */
+public abstract class AbstractInOutAsyncMessageReceiver
+ extends AbstractMessageReceiver {
+ protected Log log = LogFactory.getLog(getClass());
+ public abstract void invokeBusinessLogic(MessageContext inMessage,ServerCallback callback)
+ throws AxisFault;
+
+ public final void recieve(final MessageContext messgeCtx) throws AxisFault {
+ final ServerCallback callback = new ServerCallback() {
+ public void handleResult(MessageContext result)throws AxisFault {
+ MessageSender sender =
+ new MessageSender(messgeCtx.getEngineContext());
+ sender.send(messgeCtx);
+ }
+ public void handleFault(AxisFault fault)throws AxisFault{
+ AxisEngine engine = new AxisEngine();
+ engine.handleFault(messgeCtx,fault);
+ }
+ };
+ Runnable theadedTask = new Runnable() {
+ public void run() {
+ try {
+ invokeBusinessLogic(messgeCtx,callback);
+ } catch (AxisFault e) {
+ log.error(e);
+ }
+ }
+ };
+ (new Thread(theadedTask)).start();
+ }
+
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutSyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutSyncMessageReceiver.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutSyncMessageReceiver.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractInOutSyncMessageReceiver.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.receivers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.MessageSender;
+
+/**
+ * This is the Absract IN-OUT MEP MessageReciver. The
+ * protected abstract methods are only for the sake of breaking down the logic
+ */
+public abstract class AbstractInOutSyncMessageReceiver extends AbstractMessageReceiver {
+ public abstract MessageContext invokeBusinessLogic(MessageContext inMessage)throws AxisFault;
+
+ public final void recieve(MessageContext messgeCtx) throws AxisFault {
+ MessageContext resultContext = invokeBusinessLogic(messgeCtx);
+ MessageSender sender = new MessageSender(messgeCtx.getEngineContext());
+ sender.send(resultContext);
+ }
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.receivers;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.Constants;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.context.SessionContext;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.Parameter;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.MessageReceiver;
+
+public abstract class AbstractMessageReceiver implements MessageReceiver{
+ public static final String IMPL_INFO = "impl";
+ public static final String SCOPE = "scope";
+
+ /**
+ * Method makeNewServiceObject
+ *
+ * @param msgContext
+ * @return
+ * @throws AxisFault
+ */
+ protected Object makeNewServiceObject(MessageContext msgContext) throws AxisFault {
+ try {
+ AxisService service = msgContext.getServiceContext().getServiceConfig();
+ ClassLoader classLoader = service.getClassLoader();
+ Parameter implInfoParam = service.getParameter(IMPL_INFO);
+ if(implInfoParam != null){
+ Class implClass = Class.forName((String)implInfoParam.getValue(),true,classLoader);
+ return implClass.newInstance();
+ }else{
+ throw new AxisFault("IMPL_INFO parameter is not specified");
+ }
+
+ } catch (Exception e) {
+ throw AxisFault.makeFault(e);
+ }
+ }
+
+ /**
+ * Method getTheImplementationObject
+ *
+ * @param msgContext
+ * @return
+ * @throws AxisFault
+ */
+ protected Object getTheImplementationObject(MessageContext msgContext) throws AxisFault {
+ AxisService service = msgContext.getServiceContext().getServiceConfig();
+
+ Parameter scopeParam = service.getParameter(SCOPE);
+ String scope = Constants.MESSAGE_SCOPE;
+ QName serviceName = service.getName();
+ if (Constants.MESSAGE_SCOPE.equals(scope)) {
+ return makeNewServiceObject(msgContext);
+ } else if (Constants.SESSION_SCOPE.equals(scope)) {
+ SessionContext sessionContext = msgContext.getSessionContext();
+ Object obj = sessionContext.get(serviceName);
+ if (obj == null) {
+ obj = makeNewServiceObject(msgContext);
+ sessionContext.put(serviceName, obj);
+ }
+ return obj;
+ } else if (Constants.APPLICATION_SCOPE.equals(scope)) {
+ SessionContext globalContext = msgContext.getSessionContext();
+ Object obj = globalContext.get(serviceName);
+ if (obj == null) {
+ obj = makeNewServiceObject(msgContext);
+ globalContext.put(serviceName, obj);
+ }
+ return obj;
+ } else {
+ throw new AxisFault("unknown scope " + scope);
+ }
+ }
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractRobustInMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractRobustInMessageReceiver.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractRobustInMessageReceiver.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractRobustInMessageReceiver.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.receivers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This is takes care of the IN-OUT sync MEP in the server side
+ */
+public abstract class AbstractRobustInMessageReceiver
+ extends AbstractMessageReceiver {
+ protected Log log = LogFactory.getLog(getClass());
+ public abstract void invokeBusinessLogic(MessageContext inMessage)throws AxisFault;
+
+ public final void recieve(final MessageContext messgeCtx) throws AxisFault {
+ try {
+ invokeBusinessLogic(messgeCtx);
+ } catch (AxisFault e) {
+ AxisEngine engine = new AxisEngine();
+ engine.handleFault(messgeCtx,e);
+ }
+ }
+
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/RawXMLINOutMessageRecevier.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.receivers;
+
+import java.lang.reflect.Method;
+
+import org.apache.axis.Constants;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.MessageReceiver;
+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;
+
+/**
+ * This is a Simple java Provider.
+ */
+public class RawXMLINOutMessageRecevier extends AbstractInOutSyncMessageReceiver implements MessageReceiver {
+ /**
+ * Field log
+ */
+ protected Log log = LogFactory.getLog(getClass());
+
+ /**
+ * Field scope
+ */
+ private String scope;
+
+ /**
+ * Field method
+ */
+ private Method method;
+
+ /**
+ * Field classLoader
+ */
+ private ClassLoader classLoader;
+
+ /**
+ * Constructor RawXMLProvider
+ */
+ public RawXMLINOutMessageRecevier() {
+ scope = Constants.APPLICATION_SCOPE;
+ }
+
+
+
+
+
+ public MessageContext invokeBusinessLogic(MessageContext msgContext) throws AxisFault{
+ try {
+
+ // get the implementation class for the Web Service
+ Object obj = getTheImplementationObject(msgContext);
+
+ // find the WebService method
+ Class ImplClass = obj.getClass();
+
+ AxisOperation op = msgContext.getOperationContext().getOperationConfig();
+ if (op == null) {
+ throw new AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+ }
+ String methodName = op.getName().getLocalPart();
+ Method[] methods = ImplClass.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if (methods[i].getName().equals(methodName)) {
+ this.method = methods[i];
+ break;
+ }
+ }
+ Class[] parameters = method.getParameterTypes();
+ if ((parameters != null)
+ && (parameters.length == 1)
+ && OMElement.class.getName().equals(parameters[0].getName())) {
+ OMElement methodElement = msgContext.getEnvelope().getBody().getFirstElement();
+
+ OMElement parmeter = null;
+ SOAPEnvelope envelope = null;
+ MessageContext msgContext1 = new MessageContext(msgContext);
+
+ 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 {
+ throw new AxisFault(
+ "Raw Xml provider supports only the methods bearing the signature public OMElement "
+ + "<method-name>(OMElement) where the method name is anything");
+ }
+ } catch (Exception e) {
+ throw AxisFault.makeFault(e);
+ }
+
+ }
+}
Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/ServerCallback.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/ServerCallback.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/ServerCallback.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/ServerCallback.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.receivers;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+
+
+public interface ServerCallback {
+ public void handleResult(MessageContext result)throws AxisFault;
+ public void handleFault(AxisFault fault)throws AxisFault;
+}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java Thu Apr 14 09:39:15 2005
@@ -17,15 +17,21 @@
import java.util.ArrayList;
+import javax.xml.namespace.QName;
+
import org.apache.axis.Constants;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.AxisService;
import org.apache.axis.description.Flow;
import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.ParameterImpl;
import org.apache.axis.engine.AxisFault;
import org.apache.axis.engine.EngineConfiguration;
import org.apache.axis.engine.Handler;
+import org.apache.axis.engine.MessageReceiver;
import org.apache.axis.engine.SimplePhase;
+import org.apache.axis.receivers.AbstractMessageReceiver;
+import org.apache.axis.receivers.RawXMLINOutMessageRecevier;
public class Utils {
@@ -46,7 +52,9 @@
addHandlers(flow, p);
serviceContext.setPhases(faultchain, flowtype);
}
- public static void createExecutionChains(ServiceContext serviceContext) throws AxisFault {
+
+ public static void createExecutionChains(ServiceContext serviceContext)
+ throws AxisFault {
AxisService service = serviceContext.getServiceConfig();
addPhasesToServiceFromFlow(
serviceContext,
@@ -64,7 +72,34 @@
service.getFaultFlow(),
EngineConfiguration.FAULTFLOW);
}
- public static void addHandlers(Flow flow, SimplePhase phase) throws AxisFault {
+
+ public static AxisService createSimpleService(
+ QName serviceName,
+ MessageReceiver messageReceiver,
+ String className) {
+ AxisService service = new AxisService(serviceName);
+ service.setClassLoader(Thread.currentThread().getContextClassLoader());
+ service.addParameter(
+ new ParameterImpl(
+ AbstractMessageReceiver.IMPL_INFO,
+ className));
+ service.setMessageReceiver(messageReceiver);
+ return service;
+ }
+
+ public static ServiceContext createServiceContext(AxisService service) throws AxisFault{
+ ServiceContext serviceContext = new ServiceContext(service);
+ createExecutionChains(serviceContext);
+ return serviceContext;
+ }
+
+ public static AxisService createSimpleService(
+ QName serviceName, String className) {
+ return createSimpleService(serviceName,new RawXMLINOutMessageRecevier(),className);
+ }
+
+ public static void addHandlers(Flow flow, SimplePhase phase)
+ throws AxisFault {
if (flow != null) {
int handlerCount = flow.getHandlerCount();
for (int i = 0; i < handlerCount; i++) {
@@ -72,7 +107,5 @@
}
}
}
-
-
}
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java Thu Apr 14 09:39:15 2005
@@ -24,7 +24,7 @@
import org.apache.axis.description.Flow;
import org.apache.axis.engine.EngineConfiguration;
import org.apache.axis.engine.MessageReceiver;
-import org.apache.axis.receivers.RawXMLProvider;
+import org.apache.axis.receivers.RawXMLINOutMessageRecevier;
public class BuildERWithDeploymentTest extends AbstractTestCase {
/**
@@ -45,7 +45,7 @@
assertNotNull(service);
MessageReceiver provider = service.getMessageReceiver();
assertNotNull(provider);
- assertTrue(provider instanceof RawXMLProvider);
+ assertTrue(provider instanceof RawXMLINOutMessageRecevier);
ClassLoader cl = service.getClassLoader();
assertNotNull(cl);
Class.forName("Echo2", true, cl);
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/RegistryTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/RegistryTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/RegistryTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/RegistryTest.java Thu Apr 14 09:39:15 2005
@@ -25,7 +25,6 @@
import org.apache.axis.engine.EngineConfigurationImpl;
import org.apache.axis.engine.Handler;
import org.apache.axis.handlers.AbstractHandler;
-import org.apache.axis.receivers.RawXMLProvider;
public class RegistryTest extends AbstractTestCase {
private EngineConfiguration reg;
@@ -101,17 +100,7 @@
assertSame(flow3, flowInclude.getOutFlow());
}
- public void testProviders() {
- RawXMLProvider xmlprovider = new RawXMLProvider();
- QName name = new QName("Hi", "testing");
- xmlprovider.setName(name);
- assertEquals(xmlprovider.getName(), name);
-
- RawXMLProvider provider = new RawXMLProvider();
- provider.setName(name);
- assertEquals(provider.getName(), name);
-
- }
+
public void testHandlers() throws AxisFault {
Handler handler = new AbstractHandler() {
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/SpeakingProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/SpeakingProvider.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/SpeakingProvider.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/description/SpeakingProvider.java Thu Apr 14 09:39:15 2005
@@ -19,11 +19,10 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.engine.AxisFault;
import org.apache.axis.engine.MessageReceiver;
-import org.apache.axis.receivers.AbstractInOutReceiver;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-public class SpeakingProvider extends AbstractInOutReceiver implements MessageReceiver {
+public class SpeakingProvider implements MessageReceiver {
private Log log = LogFactory.getLog(getClass());
private String message;
Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/AbstractEngineTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/AbstractEngineTest.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/AbstractEngineTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/AbstractEngineTest.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.engine;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.Parameter;
+import org.apache.axis.handlers.AbstractHandler;
+import org.apache.axis.receivers.AbstractInOutSyncMessageReceiver;
+import org.apache.axis.transport.TransportSender;
+
+public class AbstractEngineTest extends TestCase {
+ private MessageContext mc;
+ private ArrayList executedHandlers = new ArrayList();
+ private EngineConfiguration engineRegistry;
+ private QName serviceName = new QName("axis/services/NullService");
+ private QName opearationName = new QName("NullOperation");
+ private AxisService service;
+
+ public AbstractEngineTest() {
+ }
+
+ public AbstractEngineTest(String arg0) {
+ super(arg0);
+ }
+
+ public class TempHandler extends AbstractHandler {
+ private Integer index;
+ private boolean pause = false;
+ public TempHandler(int index, boolean pause) {
+ this.index = new Integer(index);
+ this.pause = pause;
+ }
+ public TempHandler(int index) {
+ this.index = new Integer(index);
+ }
+
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ executedHandlers.add(index);
+ if (pause) {
+ msgContext.setPaused(true);
+ }
+ }
+
+ }
+
+ public class NullMessageReceiver extends AbstractInOutSyncMessageReceiver {
+
+ public MessageContext invokeBusinessLogic(MessageContext inMessage)
+ throws AxisFault {
+ return inMessage;
+ }
+
+ }
+
+ public class NullTransportSender implements TransportSender {
+ public void cleanup() throws AxisFault {
+ }
+
+ public QName getName() {
+ return null;
+ }
+
+ public Parameter getParameter(String name) {
+ return null;
+ }
+
+ public void init(HandlerMetadata handlerdesc) {
+ }
+
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ }
+
+ public void revoke(MessageContext msgContext) {
+ }
+
+ }
+
+}
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java Thu Apr 14 09:39:15 2005
@@ -20,8 +20,6 @@
import javax.xml.namespace.QName;
-import junit.framework.TestCase;
-
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
import org.apache.axis.context.EngineContext;
@@ -31,15 +29,10 @@
import org.apache.axis.description.AxisService;
import org.apache.axis.description.AxisTransportIn;
import org.apache.axis.description.AxisTransportOut;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.handlers.AbstractHandler;
import org.apache.axis.om.OMFactory;
-import org.apache.axis.receivers.AbstractInOutReceiver;
-import org.apache.axis.transport.TransportSender;
import org.apache.wsdl.WSDLService;
-public class EnginePausingTest extends TestCase {
+public class EnginePausingTest extends AbstractEngineTest {
private MessageContext mc;
private ArrayList executedHandlers = new ArrayList();
private EngineConfiguration engineRegistry;
@@ -67,7 +60,7 @@
OMFactory omFac = OMFactory.newInstance();
mc.setEnvelope(omFac.getDefaultEnvelope());
AxisService service = new AxisService(serviceName);
- service.setMessageReceiver(new NullProvider());
+ service.setMessageReceiver(new NullMessageReceiver());
ArrayList phases = new ArrayList();
SimplePhase phase = new SimplePhase("1");
@@ -135,60 +128,4 @@
}
}
-
- public class TempHandler extends AbstractHandler {
- private Integer index;
- private boolean pause = false;
- public TempHandler(int index, boolean pause) {
- this.index = new Integer(index);
- this.pause = pause;
- }
- public TempHandler(int index) {
- this.index = new Integer(index);
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- executedHandlers.add(index);
- if (pause) {
- msgContext.setPaused(true);
- }
- }
-
- }
-
- public class NullProvider extends AbstractInOutReceiver {
- public void recieve(MessageContext msgCtx) throws AxisFault {
- MessageContext newCtx =
- new MessageContext(
- msgCtx.getEngineContext(),
- msgCtx.getProperties(),
- msgCtx.getSessionContext(),msgCtx.getTransportIn(),msgCtx.getTransportOut());
- newCtx.setEnvelope(msgCtx.getEnvelope());
- }
-
- }
-
- public class NullTransportSender implements TransportSender {
- public void cleanup() throws AxisFault {
- }
-
- public QName getName() {
- return null;
- }
-
- public Parameter getParameter(String name) {
- return null;
- }
-
- public void init(HandlerMetadata handlerdesc) {
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- }
-
- public void revoke(MessageContext msgContext) {
- }
-
- }
-
}
Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithDynamicPhaseResolvingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithDynamicPhaseResolvingTest.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithDynamicPhaseResolvingTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithDynamicPhaseResolvingTest.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.engine;
+
+
+public class EngineWithDynamicPhaseResolvingTest extends AbstractEngineTest {
+
+ public EngineWithDynamicPhaseResolvingTest() {
+ }
+
+ public EngineWithDynamicPhaseResolvingTest(String arg0) {
+ super(arg0);
+ }
+ protected void setUp() throws Exception {
+ }
+
+}
Copied: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java (from r161064, webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineTest.java)
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java?view=diff&rev=161318&p1=webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineTest.java&r1=161064&p2=webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java Thu Apr 14 09:39:15 2005
@@ -20,34 +20,31 @@
import javax.xml.namespace.QName;
-import junit.framework.TestCase;
-
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
import org.apache.axis.context.EngineContext;
import org.apache.axis.context.MessageContext;
+import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.AxisService;
import org.apache.axis.description.AxisTransportIn;
import org.apache.axis.description.AxisTransportOut;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.handlers.AbstractHandler;
import org.apache.axis.om.OMFactory;
-import org.apache.axis.receivers.AbstractInOutReceiver;
-import org.apache.axis.transport.TransportSender;
import org.apache.wsdl.WSDLService;
-public class EngineTest extends TestCase {
+public class EngineWithoutPhaseResolvingTest extends AbstractEngineTest {
private MessageContext mc;
private ArrayList executedHandlers = new ArrayList();
private EngineConfiguration engineRegistry;
- private QName serviceName = new QName("NullService");
+ private QName serviceName = new QName("axis/services/NullService");
+ private QName opearationName = new QName("NullOperation");
+ private AxisService service;
- public EngineTest() {
+ public EngineWithoutPhaseResolvingTest() {
}
- public EngineTest(String arg0) {
+ public EngineWithoutPhaseResolvingTest(String arg0) {
super(arg0);
}
protected void setUp() throws Exception {
@@ -64,76 +61,43 @@
mc.setServerSide(true);
OMFactory omFac = OMFactory.newInstance();
mc.setEnvelope(omFac.getDefaultEnvelope());
- AxisService service = new AxisService(serviceName);
- service.setMessageReceiver(new NullProvider());
+ service = new AxisService(serviceName);
+ service.setMessageReceiver(new NullMessageReceiver());
engineRegistry.addService(service);
service.setStyle(WSDLService.STYLE_DOC);
+ service.addOperation(new AxisOperation(opearationName));
+
mc.setTo(
new EndpointReference(
AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis/services/NullService"));
+ "axis/services/NullService"));
+ mc.setWSAAction(opearationName.getLocalPart());
}
- public void testSend() throws Exception {
+ public void testServerSend() throws Exception {
AxisEngine engine = new AxisEngine();
- engine.receive(mc);
+ mc.setServerSide(true);
+ mc.setServiceContext(new ServiceContext(service));
+ engine.send(mc);
}
- public class TempHandler extends AbstractHandler {
- private Integer index;
- private boolean pause = false;
- public TempHandler(int index, boolean pause) {
- this.index = new Integer(index);
- this.pause = pause;
- }
- public TempHandler(int index) {
- this.index = new Integer(index);
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- executedHandlers.add(index);
- if (pause) {
- msgContext.setPaused(true);
- }
- }
-
+ public void testClientSend() throws Exception {
+ AxisEngine engine = new AxisEngine();
+ mc.setServerSide(false);
+ mc.setServiceContext(new ServiceContext(service));
+ engine.send(mc);
}
- public class NullProvider extends AbstractInOutReceiver {
- public void recieve(MessageContext msgCtx) throws AxisFault {
- MessageContext newCtx =
- new MessageContext(
- msgCtx.getEngineContext(),
- msgCtx.getProperties(),
- msgCtx.getSessionContext(),msgCtx.getTransportIn(),msgCtx.getTransportOut());
- newCtx.setEnvelope(msgCtx.getEnvelope());
- }
-
+ public void testServerReceive() throws Exception {
+ AxisEngine engine = new AxisEngine();
+ mc.setServerSide(true);
+ engine.receive(mc);
}
- public class NullTransportSender implements TransportSender {
- public void cleanup() throws AxisFault {
- }
-
- public QName getName() {
- return null;
- }
-
- public Parameter getParameter(String name) {
- return null;
- }
-
- public void init(HandlerMetadata handlerdesc) {
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- }
-
- public void revoke(MessageContext msgContext) {
- }
-
+ public void testClientReceive() throws Exception {
+ AxisEngine engine = new AxisEngine();
+ mc.setServerSide(false);
+ engine.receive(mc);
}
-
-
}
Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/PhaseResolvingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/PhaseResolvingTest.java?view=auto&rev=161318
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/PhaseResolvingTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/PhaseResolvingTest.java Thu Apr 14 09:39:15 2005
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.engine;
+
+
+public class PhaseResolvingTest extends AbstractEngineTest {
+
+ public PhaseResolvingTest() {
+ }
+
+ public PhaseResolvingTest(String arg0) {
+ super(arg0);
+ }
+ protected void setUp() throws Exception {
+
+ }
+
+ }
Modified: webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoProvider.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoProvider.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoProvider.java Thu Apr 14 09:39:15 2005
@@ -15,9 +15,13 @@
*/
package encoding.sample1;
+import java.lang.reflect.Method;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.OperationContext;
-import org.apache.axis.description.AxisOperation;
import org.apache.axis.engine.AxisFault;
import org.apache.axis.om.OMConstants;
import org.apache.axis.om.OMElement;
@@ -31,10 +35,6 @@
import org.apache.axis.testUtils.SimpleTypeEncoder;
import org.apache.axis.testUtils.SimpleTypeEncodingUtils;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-import java.lang.reflect.Method;
-
public class EchoProvider extends SimpleJavaProvider {
public Object[] deserializeParameters(
@@ -92,7 +92,7 @@
}
}
- public void receive(MessageContext msgContext) throws AxisFault {
+ public MessageContext invokeBusinessLogic(MessageContext msgContext) throws AxisFault{
try {
//get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);
Modified: webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoStub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoStub.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoStub.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/encoding/sample1/EchoStub.java Thu Apr 14 09:39:15 2005
@@ -66,7 +66,7 @@
"http://127.0.0.1:8080/axis2/services/echo");
Call call = new Call();
call.setTo(targetEPR);
- SOAPEnvelope responseEnv = call.sendReceive(envelope);
+ SOAPEnvelope responseEnv = call.sendReceiveSync(envelope);
SOAPBody body = responseEnv.getBody();
if (body.hasFault()) {
Modified: webservices/axis/trunk/java/modules/samples/src/encoding/sample2/benchMark/BenchProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/encoding/sample2/benchMark/BenchProvider.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/encoding/sample2/benchMark/BenchProvider.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/encoding/sample2/benchMark/BenchProvider.java Thu Apr 14 09:39:15 2005
@@ -16,8 +16,13 @@
package encoding.sample2.benchMark;
+import java.lang.reflect.Method;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
import org.apache.axis.context.MessageContext;
-import org.apache.axis.description.AxisOperation;
+import org.apache.axis.context.OperationContext;
import org.apache.axis.engine.AxisFault;
import org.apache.axis.om.OMConstants;
import org.apache.axis.om.OMElement;
@@ -30,10 +35,6 @@
import org.apache.axis.testUtils.SimpleTypeEncoder;
import org.apache.axis.testUtils.SimpleTypeEncodingUtils;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-import java.lang.reflect.Method;
-
/**
* Created by IntelliJ IDEA.
* User: Ajith
@@ -97,14 +98,14 @@
}
}
- public MessageContext invoke(MessageContext msgContext) throws AxisFault {
+ public MessageContext invokeBusinessLogic(MessageContext msgContext) throws AxisFault{
try {
//get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);
//find the WebService method
Class ImplClass = obj.getClass();
- AxisOperation op = msgContext.getOperation();
+ OperationContext op = msgContext.getOperationContext();
String methodName = op.getName().getLocalPart();
Modified: webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java Thu Apr 14 09:39:15 2005
@@ -17,6 +17,7 @@
package interop.doclit;
import org.apache.axis.context.MessageContext;
+import org.apache.axis.context.OperationContext;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.AxisService;
import org.apache.axis.engine.AxisFault;
@@ -81,7 +82,7 @@
}
}
- public MessageContext invoke(MessageContext msgContext) throws AxisFault {
+ public MessageContext invokeBusinessLogic(MessageContext msgContext) throws AxisFault{
try {
if (WSDLService.STYLE_DOC.equals(msgContext.getMessageStyle())) {
SOAPBody body = msgContext.getEnvelope().getBody();
@@ -114,11 +115,11 @@
}
- AxisService service = msgContext.getService();
+ AxisService service = msgContext.getServiceContext().getServiceConfig();
if (operationName != null) {
AxisOperation op = service.getOperation(operationName);
if (op != null) {
- msgContext.setOperation(op);
+ msgContext.setOperationContext(new OperationContext(op));
} else {
throw new AxisFault("Operation not found " + operationName);
}
@@ -132,7 +133,7 @@
//find the WebService method
Class ImplClass = obj.getClass();
- AxisOperation op = msgContext.getOperation();
+ OperationContext op = msgContext.getOperationContext();
methodName = op.getName().getLocalPart();
Method[] methods = ImplClass.getMethods();
Modified: webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropStub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropStub.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropStub.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropStub.java Thu Apr 14 09:39:15 2005
@@ -195,7 +195,7 @@
if (SOAPAction!=null){
call.setAction(SOAPAction);
}
- return call.sendReceive(env);
+ return call.sendReceiveSync(env);
}
Modified: webservices/axis/trunk/java/modules/samples/src/org/apache/axis/testUtils/SimpleJavaProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/org/apache/axis/testUtils/SimpleJavaProvider.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/org/apache/axis/testUtils/SimpleJavaProvider.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/org/apache/axis/testUtils/SimpleJavaProvider.java Thu Apr 14 09:39:15 2005
@@ -19,14 +19,11 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader;
import org.apache.axis.Constants;
import org.apache.axis.context.MessageContext;
-import org.apache.axis.context.SessionContext;
-import org.apache.axis.description.AxisOperation;
-import org.apache.axis.description.AxisService;
+import org.apache.axis.context.OperationContext;
import org.apache.axis.engine.AxisFault;
import org.apache.axis.engine.MessageReceiver;
import org.apache.axis.om.OMConstants;
@@ -34,7 +31,7 @@
import org.apache.axis.om.OMFactory;
import org.apache.axis.om.OMNamespace;
import org.apache.axis.om.SOAPEnvelope;
-import org.apache.axis.receivers.AbstractInOutReceiver;
+import org.apache.axis.receivers.AbstractInOutSyncMessageReceiver;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -42,7 +39,7 @@
* This is a Simple java Provider.
*/
-public class SimpleJavaProvider extends AbstractInOutReceiver implements MessageReceiver {
+public class SimpleJavaProvider extends AbstractInOutSyncMessageReceiver implements MessageReceiver {
protected Log log = LogFactory.getLog(getClass());
protected String scope;
protected Method method;
@@ -53,44 +50,6 @@
}
- protected Object makeNewServiceObject(MessageContext msgContext)
- throws AxisFault {
- try {
- AxisService service = msgContext.getServiceContext().getServiceConfig();
- Class implClass = service.getServiceClass();
- return implClass.newInstance();
- } catch (Exception e) {
- throw AxisFault.makeFault(e);
- }
- }
-
- public Object getTheImplementationObject(MessageContext msgContext)
- throws AxisFault {
- AxisService service = msgContext.getServiceContext().getServiceConfig();
- QName serviceName = service.getName();
- if (Constants.APPLICATION_SCOPE.equals(scope)) {
- return makeNewServiceObject(msgContext);
- } else if (Constants.SESSION_SCOPE.equals(scope)) {
- SessionContext sessionContext = msgContext.getSessionContext();
- Object obj = sessionContext.get(serviceName);
- if (obj == null) {
- obj = makeNewServiceObject(msgContext);
- sessionContext.put(serviceName, obj);
- }
- return obj;
- } else if (Constants.GLOBAL_SCOPE.equals(scope)) {
- SessionContext globalContext = msgContext.getSessionContext();
- Object obj = globalContext.get(serviceName);
- if (obj == null) {
- obj = makeNewServiceObject(msgContext);
- globalContext.put(serviceName, obj);
- }
- return obj;
- } else {
- throw new AxisFault("unknown scope " + scope);
- }
-
- }
public Object[] deserializeParameters(MessageContext msgContext,
Method method)
@@ -116,58 +75,60 @@
}
- public QName getName() {
- return name;
- }
-
public void receive(MessageContext msgContext) throws AxisFault {
- try {
- //get the implementation class for the Web Service
- Object obj = getTheImplementationObject(msgContext);
-
- //find the WebService method
- Class ImplClass = obj.getClass();
- AxisOperation op = msgContext.getOperation();
- String methodName = op.getName().getLocalPart();
- Method[] methods = ImplClass.getMethods();
- for (int i = 0; i < methods.length; i++) {
- if (methods[i].getName().equals(methodName)) {
- this.method = methods[i];
- break;
+ }
+ /* (non-Javadoc)
+ * @see org.apache.axis.receivers.AbstractInOutSyncMessageReceiver#invokeBusinessLogic(org.apache.axis.context.MessageContext)
+ */
+ public MessageContext invokeBusinessLogic(MessageContext msgContext)
+ throws AxisFault {
+ try {
+ //get the implementation class for the Web Service
+ Object obj = getTheImplementationObject(msgContext);
+
+ //find the WebService method
+ Class ImplClass = obj.getClass();
+ OperationContext op = msgContext.getOperationContext();
+ String methodName = op.getName().getLocalPart();
+ Method[] methods = ImplClass.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if (methods[i].getName().equals(methodName)) {
+ this.method = methods[i];
+ break;
+ }
}
+ //deserialize (XML-> java)
+ Object[] parms = deserializeParameters(msgContext, method);
+ //invoke the WebService
+ Object result = method.invoke(obj, parms);
+ Encoder outobj = new SimpleTypeEncoder(result);
+ OMFactory fac = OMFactory.newInstance();
+ SOAPEnvelope responseEnvelope = fac.getDefaultEnvelope();
+
+ OMNamespace ns = fac.createOMNamespace("http://soapenc/", "res");
+ OMElement responseMethodName =
+ fac.createOMElement(methodName + "Response", ns);
+ responseEnvelope.getBody().addChild(responseMethodName);
+ OMElement returnelement =
+ fac.createOMElement(methodName + "Return", ns);
+ responseMethodName.addChild(returnelement);
+
+ returnelement.setBuilder(new ObjectToOMBuilder(returnelement, outobj));
+ returnelement.declareNamespace(OMConstants.ARRAY_ITEM_NSURI,
+ OMConstants.ARRAY_ITEM_NS_PREFIX);
+ msgContext.setEnvelope(responseEnvelope);
+ return msgContext;
+ } catch (SecurityException e) {
+ throw AxisFault.makeFault(e);
+ } catch (IllegalArgumentException e) {
+ throw AxisFault.makeFault(e);
+ } catch (IllegalAccessException e) {
+ throw AxisFault.makeFault(e);
+ } catch (InvocationTargetException e) {
+ throw AxisFault.makeFault(e);
+ } catch (Exception e) {
+ throw AxisFault.makeFault(e);
}
- //deserialize (XML-> java)
- Object[] parms = deserializeParameters(msgContext, method);
- //invoke the WebService
- Object result = method.invoke(obj, parms);
- Encoder outobj = new SimpleTypeEncoder(result);
- OMFactory fac = OMFactory.newInstance();
- SOAPEnvelope responseEnvelope = fac.getDefaultEnvelope();
-
- OMNamespace ns = fac.createOMNamespace("http://soapenc/", "res");
- OMElement responseMethodName =
- fac.createOMElement(methodName + "Response", ns);
- responseEnvelope.getBody().addChild(responseMethodName);
- OMElement returnelement =
- fac.createOMElement(methodName + "Return", ns);
- responseMethodName.addChild(returnelement);
-
- returnelement.setBuilder(new ObjectToOMBuilder(returnelement, outobj));
- returnelement.declareNamespace(OMConstants.ARRAY_ITEM_NSURI,
- OMConstants.ARRAY_ITEM_NS_PREFIX);
- msgContext.setEnvelope(responseEnvelope);
-
- return msgContext;
- } catch (SecurityException e) {
- throw AxisFault.makeFault(e);
- } catch (IllegalArgumentException e) {
- throw AxisFault.makeFault(e);
- } catch (IllegalAccessException e) {
- throw AxisFault.makeFault(e);
- } catch (InvocationTargetException e) {
- throw AxisFault.makeFault(e);
- } catch (Exception e) {
- throw AxisFault.makeFault(e);
- }
}
+
}
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/sample1/SynchronousClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/sample1/SynchronousClient.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/sample1/SynchronousClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/sample1/SynchronousClient.java Thu Apr 14 09:39:15 2005
@@ -62,7 +62,7 @@
requestEnvelop.serialize(writer,true);
writer.flush();
System.out.println();
- SOAPEnvelope responceEnvelop = call.sendReceive(requestEnvelop);
+ SOAPEnvelope responceEnvelop = call.sendReceiveSync(requestEnvelop);
System.out.println("Responce received ...");
responceEnvelop.serialize(writer,true);
writer.flush();
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java Thu Apr 14 09:39:15 2005
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
package org.apache.axis.clientapi;
import java.io.FileReader;
@@ -29,11 +29,9 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.AxisService;
-import org.apache.axis.encoding.EncodingTest.Echo;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.SOAPEnvelope;
import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
-import org.apache.axis.providers.RawXMLProvider;
import org.apache.axis.transport.http.SimpleHTTPServer;
import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
@@ -44,11 +42,11 @@
private QName serviceName = new QName("", "EchoXMLService");
- private QName operationName = new QName("http://localhost/my", "echoOMElement");
-
- private QName transportName = new QName("http://localhost/my", "NullTransport");
-
+ private QName operationName =
+ new QName("http://localhost/my", "echoOMElement");
+ private QName transportName =
+ new QName("http://localhost/my", "NullTransport");
private MessageContext mc;
@@ -66,21 +64,16 @@
}
protected void setUp() throws Exception {
-
+ service =
+ Utils.createSimpleService(
+ serviceName,
+ org.apache.axis.engine.Echo.class.getName());
- service = new AxisService(serviceName);
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- service.setServiceClass(Echo.class);
- service.setMessageReceiver(new RawXMLProvider());
AxisOperation operation = new AxisOperation(operationName);
-
service.addOperation(operation);
- Utils.createExecutionChains(service);
-
-
UtilServer.start();
- UtilServer.deployService(service);
+ UtilServer.deployService(Utils.createServiceContext(service));
}
protected void tearDown() throws Exception {
@@ -91,18 +84,28 @@
public void testSendReceive() throws Exception {
SOAPEnvelope envelope = getBasicEnvelope();
- EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + UtilServer.TESTING_PORT + "/axis/services/EchoXMLService");
+ EndpointReference targetEPR =
+ new EndpointReference(
+ AddressingConstants.WSA_TO,
+ "http://127.0.0.1:"
+ + UtilServer.TESTING_PORT
+ + "/axis/services/EchoXMLService");
Call call = new Call();
call.setTo(targetEPR);
- SOAPEnvelope responseEnv = call.sendReceive(envelope);
- responseEnv.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), true);
+ SOAPEnvelope responseEnv = call.sendReceiveSync(envelope);
+ responseEnv.serialize(
+ XMLOutputFactory.newInstance().createXMLStreamWriter(System.out),
+ true);
}
-
private SOAPEnvelope getBasicEnvelope() throws Exception {
- SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(new FileReader("src/test-resources/clientapi/SimpleSOAPEnvelope.xml"))).getSOAPEnvelope();
+ SOAPEnvelope envelope =
+ new StAXSOAPModelBuilder(
+ XMLInputFactory.newInstance().createXMLStreamReader(
+ new FileReader("src/test-resources/clientapi/SimpleSOAPEnvelope.xml")))
+ .getSOAPEnvelope();
return envelope;
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java Thu Apr 14 09:39:15 2005
@@ -30,11 +30,9 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.AxisService;
-import org.apache.axis.engine.Echo;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.SOAPEnvelope;
import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
-import org.apache.axis.providers.RawXMLProvider;
import org.apache.axis.transport.http.SimpleHTTPServer;
import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
@@ -51,9 +49,11 @@
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 MessageContext mc;
@@ -64,7 +64,7 @@
private boolean finish = false;
private AxisService service;
-
+
private ClassLoader cl;
/**
@@ -76,18 +76,16 @@
}
protected void setUp() throws Exception {
+ service =
+ Utils.createSimpleService(
+ serviceName,
+ org.apache.axis.engine.Echo.class.getName());
- AxisService service = new AxisService(serviceName);
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- service.setServiceClass(Echo.class);
- service.setMessageReceiver(new RawXMLProvider());
AxisOperation operation = new AxisOperation(operationName);
-
service.addOperation(operation);
- Utils.createExecutionChains(service);
UtilServer.start();
- UtilServer.deployService(service);
+ UtilServer.deployService(Utils.createServiceContext(service));
}
protected void tearDown() throws Exception {
@@ -105,7 +103,9 @@
EndpointReference targetEPR =
new EndpointReference(
AddressingConstants.WSA_TO,
- "http://127.0.0.1:" + UtilServer.TESTING_PORT + "/axis/services/EchoXMLService");
+ "http://127.0.0.1:"
+ + UtilServer.TESTING_PORT
+ + "/axis/services/EchoXMLService");
Call call = new Call();
call.setTo(targetEPR);
call.setListenerTransport("http", true);
@@ -115,7 +115,8 @@
try {
result.getResponseEnvelope().serialize(
- XMLOutputFactory.newInstance().createXMLStreamWriter(System.out),
+ XMLOutputFactory.newInstance().createXMLStreamWriter(
+ System.out),
true);
} catch (XMLStreamException e) {
reportError(e);
@@ -138,7 +139,9 @@
SOAPEnvelope envelope =
new StAXSOAPModelBuilder(
XMLInputFactory.newInstance().createXMLStreamReader(
- new InputStreamReader(cl.getResourceAsStream("clientapi/SimpleSOAPEnvelope.xml"))))
+ new InputStreamReader(
+ cl.getResourceAsStream(
+ "clientapi/SimpleSOAPEnvelope.xml"))))
.getSOAPEnvelope();
/* File file = new File("./target/test-classes/clientapi/SimpleSOAPEnvelope.xml");
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CallUnregisteredServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CallUnregisteredServiceTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CallUnregisteredServiceTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CallUnregisteredServiceTest.java Thu Apr 14 09:39:15 2005
@@ -79,7 +79,7 @@
Call call = new Call();
EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + UtilServer.TESTING_PORT + "/axis/services/EchoXMLService1");
call.setTo(targetEPR);
- SOAPEnvelope resEnv = call.sendReceive(reqEnv);
+ SOAPEnvelope resEnv = call.sendReceiveSync(reqEnv);
SOAPBody sb = resEnv.getBody();
if (sb.hasFault()) {