Author: deepal
Date: Sat Apr 1 04:15:44 2006
New Revision: 390654
URL: http://svn.apache.org/viewcvs?rev=390654&view=rev
Log:
- fixing https://issues.apache.org/jira/browse/AXIS2-512
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=390654&r1=390653&r2=390654&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
Sat Apr 1 04:15:44 2006
@@ -28,6 +28,7 @@
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.i18n.Messages;
import org.apache.ws.java2wsdl.Java2WSDLConstants;
+import org.apache.wsdl.WSDLConstants;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
@@ -198,7 +199,9 @@
String mapping = (String) wsamappings.get(j);
service.mapActionToOperation(mapping, operationDesc);
}
- service.addOperation(operationDesc);
+ if (service.getOperation(operationDesc.getName()) == null) {
+ service.addOperation(operationDesc);
+ }
}
//Removing exclude operations
@@ -366,6 +369,32 @@
op_descrip = AxisOperationFactory.getOperationDescription(mepurl);
}
op_descrip.setName(new QName(opname));
+ String MEP = op_descrip.getMessageExchangePattern();
+ if (WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
+ WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+ WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+ WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+ WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+ WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+ AxisMessage inaxisMessage = op_descrip
+ .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ if (inaxisMessage != null) {
+ inaxisMessage.setName(opname);
+ }
+ }
+
+ if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+ WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+ WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+ WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+ WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+ WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+ AxisMessage outAxisMessage = op_descrip
+ .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+ if (outAxisMessage != null) {
+ outAxisMessage.setName(opname + Java2WSDLConstants.RESPONSE);
+ }
+ }
}
// setting the PolicyInclude
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java?rev=390654&r1=390653&r2=390654&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
Sat Apr 1 04:15:44 2006
@@ -157,6 +157,13 @@
// Nothing to do.
return;
}
+ // adding name spaces
+ Map map = new HashMap();
+ map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
+ Java2WSDLConstants.AXIS2_XSD);
+ map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
+ Java2WSDLConstants.URI_2001_SCHEMA_XSD);
+ axisService.setNameSpacesMap(map);
String serviceClass = (String) implInfoParam.getValue();
ClassLoader serviceClassLoader = axisService.getClassLoader();
SchemaGenerator schemaGenerator = new SchemaGenerator(serviceClassLoader,
@@ -167,13 +174,6 @@
JMethod [] method = schemaGenerator.getMethods();
TypeTable table = schemaGenerator.getTypeTable();
PhasesInfo pinfo = axisConfig.getPhasesInfo();
- // adding name spaces
- Map map = new HashMap();
- map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
- Java2WSDLConstants.AXIS2_XSD);
- map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
- Java2WSDLConstants.URI_2001_SCHEMA_XSD);
- axisService.setNameSpacesMap(map);
for (int i = 0; i < method.length; i++) {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java?rev=390654&r1=390653&r2=390654&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
Sat Apr 1 04:15:44 2006
@@ -9,13 +9,7 @@
import org.apache.ws.java2wsdl.Java2WSDLConstants;
import org.apache.wsdl.WSDLConstants;
import org.apache.wsdl.WSDLExtensibilityElement;
-import org.apache.wsdl.extensions.DefaultExtensibilityElement;
-import org.apache.wsdl.extensions.PolicyExtensibilityElement;
-import org.apache.wsdl.extensions.SOAPAddress;
-import org.apache.wsdl.extensions.SOAPBinding;
-import org.apache.wsdl.extensions.SOAPBody;
-import org.apache.wsdl.extensions.SOAPHeader;
-import org.apache.wsdl.extensions.SOAPOperation;
+import org.apache.wsdl.extensions.*;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
@@ -85,7 +79,7 @@
String key = (String) keys.next();
if ("".equals(key)) {
ele.declareDefaultNamespace((String) nameSpaceMap.get(key));
- }else {
+ } else {
ele.declareNamespace((String) nameSpaceMap.get(key), key);
}
}
@@ -100,16 +94,18 @@
ele.addAttribute("targetNamespace", axisService.getTargetNamespace(), null);
OMElement wsdlTypes = fac.createOMElement("types", wsdl);
+ ele.addChild(wsdlTypes);
StringWriter writer = new StringWriter();
axisService.printSchema(writer);
- XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
- XMLStreamReader xmlReader = xmlInputFactory.createXMLStreamReader(new
- ByteArrayInputStream(writer.toString().getBytes()));
-
- StAXOMBuilder staxOMBuilder = new
- StAXOMBuilder(fac, xmlReader);
- ele.addChild(wsdlTypes);
- wsdlTypes.addChild(staxOMBuilder.getDocumentElement());
+ if (!"".equals(writer.toString())) {
+ XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
+ XMLStreamReader xmlReader = xmlInputFactory.createXMLStreamReader(new
+ ByteArrayInputStream(writer.toString().getBytes()));
+
+ StAXOMBuilder staxOMBuilder = new
+ StAXOMBuilder(fac, xmlReader);
+ wsdlTypes.addChild(staxOMBuilder.getDocumentElement());
+ }
generateMessages(fac, ele);
generatePortType(fac, ele);
generateSOAPBinding(fac, ele);
|