You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/05/06 10:02:19 UTC
svn commit: r168561 - in /webservices/axis/trunk/java/modules:
core/src/org/apache/axis/clientapi/ core/src/org/apache/axis/context/
core/src/org/apache/axis/description/ core/test/org/apache/axis/engine/
core/test/org/apache/axis/handlers/addressing/
wsdl/src/org/apache/axis/wsdl/builder/
wsdl/src/org/apache/axis/wsdl/databinding/
wsdl/src/org/apache/axis/wsdl/tojava/
wsdl/src/org/apache/axis/wsdl/tojava/emitter/
wsdl/src/org/apache/axis/wsdl/tojava/extension/
Author: chathura
Date: Fri May 6 01:02:18 2005
New Revision: 168561
URL: http://svn.apache.org/viewcvs?rev=168561&view=rev
Log:
Changed the OperaionContextFactory method. Fixed the AxisOperatiion findOperationContext method.
Added:
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientStubWriter.java
Modified:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContextFactory.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextTest.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/handlers/addressing/AddressingOutHandlerTest.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDL2ToWOMBuilder.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenConfiguration.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationEngine.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationException.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOption.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionConstants.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionParser.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClassWriterConstants.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientInterfaceWriter.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientJavaEmitter.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/Emitter.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AbstractCodeGenerationExtension.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AxisBindingBuilder.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/CodeGenExtention.java
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/PolicyEvaluator.java
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java Fri May 6 01:02:18 2005
@@ -194,7 +194,7 @@
null,
transportIn,
transportOut,
- OperationContextFactory.createMEP(WSDLConstants.MEP_URI_IN_OUT,false,axisOperation, null));
+ OperationContextFactory.createMEPContext(WSDLConstants.MEP_URI_IN_OUT,false,axisOperation, null));
msgctx.setEnvelope(env);
msgctx.setMessageInformationHeaders(messageInfoHeaders);
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContextFactory.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContextFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContextFactory.java Fri May 6 01:02:18 2005
@@ -23,7 +23,7 @@
public class OperationContextFactory implements WSDLConstants {
- public static OperationContext createMEP(String mepURI, boolean serverSide,
+ public static OperationContext createMEPContext(String mepURI, boolean serverSide,
AxisOperation axisOp, ServiceContext serviceContext)
throws AxisFault {
if (MEP_URI_IN_OUT.equals(mepURI) || MEP_URI_IN_ONLY.equals(mepURI)
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java Fri May 6 01:02:18 2005
@@ -1,6 +1,5 @@
package org.apache.axis.description;
-
import java.util.ArrayList;
import java.util.Collection;
@@ -16,80 +15,78 @@
/**
* @author chathura@opensource.lk
- *
+ *
*/
public class AxisOperation extends WSDLOperationImpl implements
- ParameterInclude, WSDLOperation,DescriptionConstants ,PhasesInclude{
-
-
+ ParameterInclude, WSDLOperation, DescriptionConstants, PhasesInclude {
- private MessageReceiver messageReceiver;
+ private MessageReceiver messageReceiver;
- public AxisOperation(){
- this.setMessageExchangePattern(MEP_URI_IN_OUT);
- this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
- this.setComponentProperty(MODULEREF_KEY, new ArrayList());
- this.setComponentProperty(PHASES_KEY, new PhasesIncludeImpl());
+ public AxisOperation() {
+ this.setMessageExchangePattern(MEP_URI_IN_OUT);
+ this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
+ this.setComponentProperty(MODULEREF_KEY, new ArrayList());
+ this.setComponentProperty(PHASES_KEY, new PhasesIncludeImpl());
}
-
- public AxisOperation(QName name){
+
+ public AxisOperation(QName name) {
this();
this.setName(name);
}
+ public void addModule(QName moduleref) {
+ if (moduleref == null) {
+ return;
+ }
+ Collection collectionModule = (Collection) this
+ .getComponentProperty(MODULEREF_KEY);
+ collectionModule.add(moduleref);
+ }
- public void addModule(QName moduleref) {
- if (moduleref == null) {
- return;
- }
- Collection collectionModule =
- (Collection) this.getComponentProperty(MODULEREF_KEY);
- collectionModule.add(moduleref);
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.axis.description.AxisService#getModules()
- */
-
- /**
- * Method getModules
- *
- * @return
- */
- public Collection getModules() {
- return (Collection) this.getComponentProperty(MODULEREF_KEY);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.axis.description.AxisService#getModules()
+ */
+ /**
+ * Method getModules
+ *
+ * @return
+ */
+ public Collection getModules() {
+ return (Collection) this.getComponentProperty(MODULEREF_KEY);
+ }
+
+ /**
+ * Method addParameter
+ *
+ * @param param
+ * Parameter that will be added
+ */
+ public void addParameter(Parameter param) {
+ if (param == null) {
+ return;
+ }
+ ParameterIncludeImpl paramInclude = (ParameterIncludeImpl) this
+ .getComponentProperty(PARAMETER_KEY);
+ paramInclude.addParameter(param);
+ }
+
+ /**
+ * Method getParameter
+ *
+ * @param name
+ * Name of the parameter
+ * @return
+ */
+ public Parameter getParameter(String name) {
+ ParameterIncludeImpl paramInclude = (ParameterIncludeImpl) this
+ .getComponentProperty(PARAMETER_KEY);
+ return (Parameter) paramInclude.getParameter(name);
+ }
/**
- * Method addParameter
- *
- * @param param Parameter that will be added
- */
- public void addParameter(Parameter param) {
- if (param == null) {
- return;
- }
- ParameterIncludeImpl paramInclude =
- (ParameterIncludeImpl) this.getComponentProperty(PARAMETER_KEY);
- paramInclude.addParameter(param);
- }
-
-
- /**
- * Method getParameter
- *
- * @param name Name of the parameter
- * @return
- */
- public Parameter getParameter(String name) {
- ParameterIncludeImpl paramInclude =
- (ParameterIncludeImpl) this.getComponentProperty(PARAMETER_KEY);
- return (Parameter) paramInclude.getParameter(name);
- }
-
- /**
* This method is responsible for finding a MEPContext for an incomming
* messages. An incomming message can be of two states.
*
@@ -111,76 +108,78 @@
* @param msgContext
* @return
*/
- public OperationContext findMEPContext(MessageContext msgContext, boolean serverside)
- throws AxisFault {
- OperationContext mepContext = null;
-
+ public OperationContext findMEPContext(MessageContext msgContext,
+ boolean serverside) throws AxisFault {
+ OperationContext operationContext = null;
if (null == msgContext.getRelatesTo()) {
//Its a new incomming message so get the factory to create a new
// one
- mepContext = OperationContextFactory.createMEPContext(this
- .getMessageExchangePattern(), serverside,this,msgContext.getServiceContext());
-
+ operationContext = OperationContextFactory.createMEPContext(this
+ .getMessageExchangePattern(), serverside, this, msgContext
+ .getSessionContext());
} else {
// So this message is part of an ongoing MEP
- mepContext = msgContext.getEngineContext().getMEPContext(msgContext.getRelatesTo().getValue());
+ // operationContext =
+ // msgContext.getEngineContext().getMEPContext(msgContext.getRelatesTo().getValue());
- if (null == mepContext) {
+ if (null == operationContext) {
throw new AxisFault(
"Cannot relate the message in the operation :"
- + this.getName() + " :Unrelated RelatesTO value "+msgContext.getRelatesTo().getValue());
+ + this.getName()
+ + " :Unrelated RelatesTO value "
+ + msgContext.getRelatesTo().getValue());
}
}
- msgContext.getEngineContext().addMEPContext(msgContext.getMessageID(), mepContext);
- mepContext.addMessageContext(msgContext);
- msgContext.setMepContext(mepContext);
- if (mepContext.isComplete ()) {
- mepContext.cleanup ();
- }
- }
-// return mepContext;
+ // msgContext.getEngineContext().addMEPContext(msgContext.getMessageID(),
+ // operationContext);
+ operationContext.addMessageContext(msgContext);
+ msgContext.setOperationContext(operationContext);
+ if (operationContext.isComplete()) {
+ operationContext.cleanup();
+ }
+
+ return operationContext;
}
+ public MessageReceiver getMessageReciever() {
+ return messageReceiver;
+ }
+ public void setMessageReciever(MessageReceiver messageReceiver) {
+ this.messageReceiver = messageReceiver;
+ }
- public MessageReceiver getMessageReciever() {
- return messageReceiver;
- }
-
- public void setMessageReciever(MessageReceiver messageReceiver) {
- this.messageReceiver = messageReceiver;
- }
-
- public void setPhases(ArrayList phases, int flow) throws AxisFault {
- if (phases == null) {
- return;
- }
- PhasesIncludeImpl phaseInclude =
- (PhasesIncludeImpl) this.getComponentProperty(PHASES_KEY);
- phaseInclude.setPhases(phases, flow);
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.axis.description.PhasesInclude#getPhases(int)
- */
-
- /**
- * Method getPhases
- *
- * @param flow
- * @return
- * @throws AxisFault
- */
- public ArrayList getPhases(int flow) throws AxisFault {
- PhasesIncludeImpl phaseInclude =
- (PhasesIncludeImpl) this.getComponentProperty(PHASES_KEY);
- return (ArrayList) phaseInclude.getPhases(flow);
- }
+ public void setPhases(ArrayList phases, int flow) throws AxisFault {
+ if (phases == null) {
+ return;
+ }
+ PhasesIncludeImpl phaseInclude = (PhasesIncludeImpl) this
+ .getComponentProperty(PHASES_KEY);
+ phaseInclude.setPhases(phases, flow);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.axis.description.PhasesInclude#getPhases(int)
+ */
+
+ /**
+ * Method getPhases
+ *
+ * @param flow
+ * @return
+ * @throws AxisFault
+ */
+ public ArrayList getPhases(int flow) throws AxisFault {
+ PhasesIncludeImpl phaseInclude = (PhasesIncludeImpl) this
+ .getComponentProperty(PHASES_KEY);
+ return (ArrayList) phaseInclude.getPhases(flow);
+ }
}
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?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- 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 Fri May 6 01:02:18 2005
@@ -58,7 +58,7 @@
AxisOperation axisOp = new AxisOperation(operationName);
- mc = new MessageContext(engineContext, null, null, transportIn,transportOut,OperationContextFactory.createMEP(WSDLConstants.MEP_URI_IN_OUT,false,axisOp,null));
+ mc = new MessageContext(engineContext, null, null, transportIn,transportOut,OperationContextFactory.createMEPContext(WSDLConstants.MEP_URI_IN_OUT,false,axisOp,null));
mc.setTransportOut(transportOut);
mc.setServerSide(true);
SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java Fri May 6 01:02:18 2005
@@ -67,7 +67,7 @@
null,
transportIn,
transport,
- OperationContextFactory.createMEP(WSDLConstants.MEP_URI_IN_OUT,false,axisOp, null));
+ OperationContextFactory.createMEPContext(WSDLConstants.MEP_URI_IN_OUT,false,axisOp, null));
mc.setTransportOut(transport);
mc.setServerSide(true);
SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextTest.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextTest.java Fri May 6 01:02:18 2005
@@ -40,7 +40,7 @@
null,
null,
null,
- OperationContextFactory.createMEP(WSDLConstants.MEP_URI_IN_OUT, false, null, null));
+ OperationContextFactory.createMEPContext(WSDLConstants.MEP_URI_IN_OUT, false, null, null));
SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/handlers/addressing/AddressingOutHandlerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/handlers/addressing/AddressingOutHandlerTest.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/handlers/addressing/AddressingOutHandlerTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/handlers/addressing/AddressingOutHandlerTest.java Fri May 6 01:02:18 2005
@@ -48,7 +48,7 @@
super.setUp();
outHandler = new AddressingOutHandler();
testUtil = new TestUtil();
- msgCtxt = new MessageContext(null, null, null, null,null,OperationContextFactory.createMEP(WSDLConstants.MEP_URI_IN_OUT,false,null,null));
+ msgCtxt = new MessageContext(null, null, null, null,null,OperationContextFactory.createMEPContext(WSDLConstants.MEP_URI_IN_OUT,false,null,null));
}
public void testAddToSOAPHeader() throws Exception {
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDL2ToWOMBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDL2ToWOMBuilder.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDL2ToWOMBuilder.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDL2ToWOMBuilder.java Fri May 6 01:02:18 2005
@@ -32,5 +32,6 @@
public WSDLDescription build(InputStream in, WSDLComponentFactory wsdlComponenetFactory)throws WSDLException{
throw new UnsupportedOperationException("Not Implemented");
+
}
}
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.databinding;
import javax.xml.namespace.QName;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.databinding;
import javax.xml.namespace.QName;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenConfiguration.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenConfiguration.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenConfiguration.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava;
import java.io.File;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationEngine.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationEngine.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationEngine.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava;
import java.io.File;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationException.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationException.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CodeGenerationException.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava;
/**
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOption.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOption.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOption.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOption.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava;
/**
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionConstants.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionConstants.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionConstants.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava;
/**
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionParser.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionParser.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/CommandLineOptionParser.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava;
import java.util.ArrayList;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClassWriterConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClassWriterConstants.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClassWriterConstants.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClassWriterConstants.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.emitter;
/**
@@ -6,16 +22,31 @@
*/
public interface ClassWriterConstants {
- public static final String CLASS_FILE_EXTENSION = ".java";
-
- public static final String REMOTE_INTERFACE = "java.rmi.Remote";
+ public static final String CLASS_FILE_EXTENSION = ".java";
public static final String PUBLIC_INTERFACE = "public interface ";
public static final String PUBLIC_CLASS = "public class";
+
+ public static final String REMOTE_INTERFACE = "java.rmi.Remote";
+
public static final String REMOTE_EXCEPTION = "java.rmi.RemoteException";
+ public static final String ABSTRACT_STUB = "org.apache.axis.clientapi.Stub";
+
+ public static final String AXIS_OPERATION = "org.apache.axis.description.AxisOperation";
+
+
public static final String INDENDATION_TAB = "\t";
+
+ public static final String INDENDATION_DOUBLE_TAB = "\t\t";
+
+ public static final String INDENDATION_SPACE = " ";
+
+
+ public static final String STUB_VARIABLE__OPERATION_ARRRAY = "_operations";
+
+ public static final String STUB_VARIABLE___OPERATION ="__operation";
}
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientInterfaceWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientInterfaceWriter.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientInterfaceWriter.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientInterfaceWriter.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.emitter;
import java.io.File;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientJavaEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientJavaEmitter.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientJavaEmitter.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientJavaEmitter.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.emitter;
import java.io.IOException;
@@ -33,10 +49,10 @@
public void emitStub() throws CodeGenerationException{
WSDLBinding axisBinding = this.configuration.getWom().getBinding(AxisBindingBuilder.AXIS_BINDING_QNAME);
ClientInterfaceWriter clientInterfaceWriter = new ClientInterfaceWriter(axisBinding.getBoundInterface(), this.configuration.getOutputLocation(), new DefaultTypeMapper());
-// ClientStubWriter clientStubWriter = new ClientStubWriter(axisBinding.getBoundInterface(), this.configuration.getOutputLocation(), new DefaultTypeMapper());
+ ClientStubWriter clientStubWriter = new ClientStubWriter(axisBinding.getBoundInterface(), this.configuration.getOutputLocation(), new DefaultTypeMapper());
try {
clientInterfaceWriter.emit();
-// clientStubWriter.emit();
+ clientStubWriter.emit();
} catch (IOException e) {
throw new CodeGenerationException(e);
}
Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientStubWriter.java?rev=168561&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientStubWriter.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/ClientStubWriter.java Fri May 6 01:02:18 2005
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.emitter;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Iterator;
+
+import org.apache.axis.wsdl.databinding.TypeMapper;
+import org.apache.wsdl.WSDLInterface;
+import org.apache.wsdl.WSDLOperation;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public class ClientStubWriter implements ClassWriterConstants{
+
+ private WSDLInterface womInterface;
+
+ private File directory;
+
+ private TypeMapper typeMapper;
+
+
+
+ /**
+ * @param wsdlInterface
+ * @param directory
+ * @param typeMapper
+ */
+ public ClientStubWriter(WSDLInterface wsdlInterface, File directory,
+ TypeMapper typeMapper) {
+ this.womInterface = wsdlInterface;
+ this.directory = directory;
+ this.typeMapper = typeMapper;
+ }
+
+ public void emit() throws IOException{
+
+ String name = womInterface.getName().getLocalPart();
+ name += "Stub";
+ OutputStream out = new FileOutputStream(new File(directory, name+CLASS_FILE_EXTENSION));
+
+ PrintStream printStream = new PrintStream(out);
+ printStream.println(PUBLIC_CLASS + INDENDATION_SPACE
+ + name
+ + " extends "
+ + ABSTRACT_STUB
+ + " implements "+REMOTE_INTERFACE+ "{");
+ printStream.println();
+
+
+
+ ///Start of Static block
+ printStream.println(INDENDATION_TAB+"static {");
+ printStream.println(INDENDATION_DOUBLE_TAB+ INDENDATION_SPACE
+ +AXIS_OPERATION +INDENDATION_SPACE
+ +STUB_VARIABLE___OPERATION +";");
+
+ Iterator iterator = womInterface.getAllOperations().values()
+ .iterator();
+ int operationCounter = 0;
+ while (iterator.hasNext()) {
+ WSDLOperation operation = (WSDLOperation) iterator.next();
+ printStream.println();
+ printStream.println(INDENDATION_DOUBLE_TAB + STUB_VARIABLE___OPERATION
+ +INDENDATION_SPACE + "="
+ +INDENDATION_SPACE + "new"
+ +INDENDATION_SPACE + AXIS_OPERATION
+ +"("+"}"+";");
+
+ printStream.println(INDENDATION_DOUBLE_TAB
+ +STUB_VARIABLE__OPERATION_ARRRAY
+ +"["+operationCounter+"]"
+ +INDENDATION_SPACE + "="+INDENDATION_SPACE
+ +STUB_VARIABLE___OPERATION +";");
+ printStream.println();
+
+
+ operationCounter++;
+ }
+ printStream.println(INDENDATION_TAB+"}");
+ ///End of Static block
+ printStream.println("}");
+ printStream.flush();
+ printStream.close();
+
+
+ }
+}
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/Emitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/Emitter.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/Emitter.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/emitter/Emitter.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.emitter;
import org.apache.axis.wsdl.tojava.CodeGenConfiguration;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AbstractCodeGenerationExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AbstractCodeGenerationExtension.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AbstractCodeGenerationExtension.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AbstractCodeGenerationExtension.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.extension;
import org.apache.axis.wsdl.tojava.CodeGenConfiguration;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AxisBindingBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AxisBindingBuilder.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AxisBindingBuilder.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/AxisBindingBuilder.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.extension;
import javax.xml.namespace.QName;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/CodeGenExtention.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/CodeGenExtention.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/CodeGenExtention.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/CodeGenExtention.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.extension;
import org.apache.axis.wsdl.tojava.CodeGenConfiguration;
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/PolicyEvaluator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/PolicyEvaluator.java?rev=168561&r1=168560&r2=168561&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/PolicyEvaluator.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/extension/PolicyEvaluator.java Fri May 6 01:02:18 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2001-2004 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.wsdl.tojava.extension;
import org.apache.axis.wsdl.tojava.CodeGenConfiguration;