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 ja...@apache.org on 2005/07/06 12:32:47 UTC

svn commit: r209442 - in /webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc: ./ client/ factory/

Author: jayachandra
Date: Wed Jul  6 03:32:42 2005
New Revision: 209442

URL: http://svn.apache.org/viewcvs?rev=209442&view=rev
Log:
Added a facade between various wsdl parsing mechanisms and our jaxrpc implementation so as to make jaxrpc runtime agnostic to the parser used underneath. The compilation succeeds only if one has the javax.wsdl.* api interfaces in the class path.

Added:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL11Interface.java
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL20Interface.java
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDLInterface.java
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/factory/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/factory/WSDLFactoryImpl.java
Modified:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL11Interface.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL11Interface.java?rev=209442&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL11Interface.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL11Interface.java Wed Jul  6 03:32:42 2005
@@ -0,0 +1,56 @@
+/*
+ * 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.jaxrpc;
+
+import javax.wsdl.*;
+import java.net.URL;
+import javax.xml.namespace.QName;
+
+/**
+ * @author sunja07
+ *
+ */
+public interface JAXRPCWSDL11Interface extends JAXRPCWSDLInterface {
+	
+	public Service getService(URL wsdlLocation, QName serviceName);
+	
+	public Port getPort(URL wsdlLocation, QName portName);
+	
+	public Port getPort(Service service, QName portName);
+	
+	public Port[] getPorts(URL wsdlLocation, QName serviceName);
+	
+	public Port[] getPorts(Service service);
+	
+	public String[] getPortNames(URL wsdlLocation, QName serviceName);
+	
+	public Binding getBinding(URL wsdlLocation, QName portName);
+	
+	public QName getPortTypeName(Binding binding);
+	
+	public PortType getPortType(URL wsdlLocation, QName portTypeName);
+	
+	public PortType getPortType(Binding binding);
+	
+	public Operation[] getOperations(URL wsdlLocation, QName portTypeName);
+	
+	public Operation[] getOperations(PortType portType);
+	
+	public Operation getOperation(URL wsdlLocation, QName portTypeName, QName opName);
+	
+	public Operation getOperation(PortType portType, QName opName);
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL20Interface.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL20Interface.java?rev=209442&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL20Interface.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDL20Interface.java Wed Jul  6 03:32:42 2005
@@ -0,0 +1,23 @@
+/*
+ * 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.jaxrpc;
+
+public interface JAXRPCWSDL20Interface extends JAXRPCWSDLInterface {
+
+	//I haven't seriously looked into WSDL2.0 So can't finalize what
+	//would be the method names here. Will do so after I have a look at
+	//WSDL2.0 spec.
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDLInterface.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDLInterface.java?rev=209442&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDLInterface.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCWSDLInterface.java Wed Jul  6 03:32:42 2005
@@ -0,0 +1,26 @@
+/*
+ * 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.jaxrpc;
+
+public interface JAXRPCWSDLInterface {
+	
+	static final String WSDL2_VERSION = "2.0";
+	
+	static final String WSDL11_VERSION = "1.1";
+	
+	public String getWSDLVersion();
+
+}

Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java?rev=209442&r1=209441&r2=209442&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java Wed Jul  6 03:32:42 2005
@@ -1,5 +1,17 @@
-/**
- * 
+/*
+ * 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.jaxrpc.client;
 

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/factory/WSDLFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/factory/WSDLFactoryImpl.java?rev=209442&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/factory/WSDLFactoryImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/factory/WSDLFactoryImpl.java Wed Jul  6 03:32:42 2005
@@ -0,0 +1,73 @@
+/*
+ * 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.jaxrpc.factory;
+
+import java.net.URL;
+import org.apache.axis.jaxrpc.JAXRPCWSDLInterface;
+
+/**
+ * @author sunja07
+ *
+ */
+public class WSDLFactoryImpl {
+	
+	static final int WSDL4J_PARSER_CHOICE = 0;
+	
+	static final int WODEN_PARSER_CHOICE = 1;
+	
+	static final int CUSTOM_PARSER_CHOICE = 2;
+	
+	static final int DEFAULT_CHOICE = 0;
+
+	/**
+	 * 
+	 */
+	public WSDLFactoryImpl() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * Method getParser
+	 * Based on the choice indicated, appropriate adapter class that implements
+	 * the JAXRPCWSDLInterface leveraging the parsing mechanism functionality
+	 * offered by the parser of the indicated choice is instantiated and 
+	 * returned.
+	 * @param choice
+	 * @return
+	 */
+	public static JAXRPCWSDLInterface getParser(int choice, URL wsdlLocation) {
+		//May be in this method you need to see what kind of wsdl version is
+		//this wsdl and get the appropriate adapter class instantiated.
+		//All that I wanted to hint is there can be different adapter classes
+		//for 1.1 and 2.0, as we have JAXRPCWSDL11Interface different from
+		//JAXRPCWSDL20Interface. So in such a case single adapter class will
+		//not be sufficient, but you will have mulitple adapter classes. And
+		//which class to instantiate would be decided by checking the wsdl type
+		switch(choice) {
+		case 0: 
+			//return the wsdl4j adapter class instance
+		case 1:
+			//return the woden adapter class instance
+		case 2:
+			//return the custom wsdl parsing adapter class instance
+			//and so on
+		}
+		//For now, no adapter class is coded. So...
+		return null;
+	}
+
+}