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 de...@apache.org on 2006/07/24 08:00:37 UTC
svn commit: r424920 - in /webservices/axis2/trunk/java/modules:
core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/description/
java2wsdl/src/org/apache/ws/java2wsdl/
Author: deepal
Date: Sun Jul 23 23:00:37 2006
New Revision: 424920
URL: http://svn.apache.org/viewvc?rev=424920&view=rev
Log:
- fixing buildModule problem (remove private axisConfig field)
- fix wrong name spaces generation in SchemaGenarator
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLUtils.java
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=424920&r1=424919&r2=424920&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java Sun Jul 23 23:00:37 2006
@@ -521,7 +521,7 @@
currentArchiveFile.setClassLoader(false, config.getModuleClassLoader());
axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule,
- false, axisConfig);
+ false, config);
ClassLoader moduleClassLoader = axismodule.getModuleClassLoader();
Flow inflow = axismodule.getInFlow();
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=424920&r1=424919&r2=424920&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Sun Jul 23 23:00:37 2006
@@ -51,6 +51,7 @@
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
+import javax.wsdl.xml.WSDLWriter;
import javax.xml.namespace.QName;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
@@ -518,9 +519,24 @@
}
public void printWSDL(OutputStream out, String requestIP, String servicePath) throws AxisFault {
- ArrayList eprList = new ArrayList();
- String[] eprArray = getServiceEprs(requestIP, eprList);
- getWSDL(out, eprArray, servicePath);
+ if (isUseUserWSDL()) {
+ Parameter wsld4jdefinition = getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
+ if (wsld4jdefinition != null) {
+ try {
+ Definition definition = (Definition) wsld4jdefinition.getValue();
+ WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
+ writer.writeWSDL(definition, out);
+ } catch (WSDLException e) {
+ throw new AxisFault(e);
+ }
+ } else {
+ printWSDLError(out);
+ }
+ } else {
+ ArrayList eprList = new ArrayList();
+ String[] eprArray = getServiceEprs(requestIP, eprList);
+ getWSDL(out, eprArray, servicePath);
+ }
}
private String[] getServiceEprs(String requestIP, ArrayList eprList) throws AxisFault {
@@ -606,22 +622,26 @@
throw new AxisFault(e);
}
} else {
- try {
- String wsdlntfound = "<error>" +
- "<description>Unable to generate WSDL for this service</description>" +
- "<reason>Either user has not dropped the wsdl into META-INF or" +
- " operations use message receivers other than RPC.</reason>" +
- "</error>";
- out.write(wsdlntfound.getBytes());
- out.flush();
- out.close();
- } catch (IOException e) {
- throw new AxisFault(e);
- }
+ printWSDLError(out);
}
}
+ private void printWSDLError(OutputStream out) throws AxisFault {
+ try {
+ String wsdlntfound = "<error>" +
+ "<description>Unable to generate WSDL for this service</description>" +
+ "<reason>Either user has not dropped the wsdl into META-INF or" +
+ " operations use message receivers other than RPC.</reason>" +
+ "</error>";
+ out.write(wsdlntfound.getBytes());
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ throw new AxisFault(e);
+ }
+ }
+
//WSDL 2.0
public void printWSDL2(OutputStream out) throws AxisFault {
setWsdlfound(true);
@@ -647,18 +667,7 @@
throw new AxisFault(e);
}
} else {
- try {
- String wsdlntfound = "<error>" +
- "<description>Unable to generate WSDL for this service</description>" +
- "<reason>Either user has not dropped the wsdl into META-INF or" +
- " operations use message receivers other than RPC.</reason>" +
- "</error>";
- out.write(wsdlntfound.getBytes());
- out.flush();
- out.close();
- } catch (IOException e) {
- throw new AxisFault(e);
- }
+ printWSDLError(out);
}
}
@@ -1410,5 +1419,23 @@
public void setElementFormDefault(boolean elementFormDefault) {
this.elementFormDefault = elementFormDefault;
+ }
+
+ /**
+ * User can set a paramter in services.xml saying he want to show the original wsdl
+ * that he put into META-INF once someone ask for ?wsdl
+ * so if you want to use your own wsdl then add following parameter into
+ * services.xml
+ * <parameter name="useOriginalwsdl">true</parameter>
+ */
+ public boolean isUseUserWSDL() {
+ Parameter parameter = getParameter("useOriginalwsdl");
+ if (parameter != null) {
+ String value = (String) parameter.getValue();
+ if ("true".equals(value)) {
+ return true;
+ }
+ }
+ return false;
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=424920&r1=424919&r2=424920&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Sun Jul 23 23:00:37 2006
@@ -241,7 +241,6 @@
* a new element
*
* @param wsdl4jTypes
- * @return
*/
private Map populateSchemaMap(Types wsdl4jTypes) {
@@ -363,7 +362,7 @@
PortType portType = binding.getPortType();
processPortType(portType, dif);
- String portTypeNs = portType.getQName().getNamespaceURI();
+// String portTypeNs = portType.getQName().getNamespaceURI();
List list = binding.getBindingOperations();
for (int i = 0; i < list.size(); i++) {
BindingOperation wsdl4jBindingOperation = (BindingOperation) list
@@ -465,7 +464,6 @@
*
* @param name
* @param faultMessages
- * @return
*/
private AxisMessage findFaultMessage(String name, ArrayList faultMessages) {
AxisMessage tempMessage;
@@ -575,7 +573,6 @@
*
* @param outMessage
* @param wsdl4jOperation
- * @param bindingInput
* @param isWrapped
*/
private void AddQNameReference(AxisMessage outMessage,
@@ -639,11 +636,6 @@
/**
* Add the QName for the binding output
- *
- * @param outMessage
- * @param wsdl4jOperation
- * @param bindingInput
- * @param isWrapped
*/
private void AddQNameReference(AxisMessage faultMessage,
Message wsdl4jMessage) {
@@ -667,7 +659,6 @@
* included in the binding operation
*
* @param bindingOp
- * @return
*/
private String getSOAPStyle(BindingOperation bindingOp) {
List extensibilityElements = bindingOp.getExtensibilityElements();
@@ -883,7 +874,6 @@
/**
* Generates a list of wrapper schemas
*
- * @param wsdl4jDefinition
* @param wsdl4jBinding
*/
private Element[] generateWrapperSchema(
@@ -1259,7 +1249,6 @@
}
/**
- * @param namespaceDeclaration
* @param prefixMap
*/
private void checkAndAddNamespaceDeclarations(String namespace,
@@ -1718,7 +1707,6 @@
* Look for the wrappable operations depending on the style
*
* @param binding
- * @return
*/
private List findWrappableOperations(Binding binding) {
//first find the global style declaration.
Modified: webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLUtils.java?rev=424920&r1=424919&r2=424920&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLUtils.java (original)
+++ webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLUtils.java Sun Jul 23 23:00:37 2006
@@ -54,8 +54,8 @@
if (currentIndex > 0) {
strBuf.append(HTTP);
} else if(currentIndex ==-1){
- strBuf.append(HTTP);
- strBuf.append(packageName);
+// strBuf.append(HTTP);
+// strBuf.append(packageName);
return strBuf;
}
while (currentIndex != -1) {
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org