butek 2002/09/24 13:29:18
Modified: java/src/org/apache/axis/i18n resource.properties
java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
Log:
Fixed http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10365.
If a binding operation doesn't match a portType operation, we now fail.
We used to generate sort-of-duplicate operations.
Revision Changes Path
1.5 +2 -0 xml-axis/java/src/org/apache/axis/i18n/resource.properties
Index: resource.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- resource.properties 23 Sep 2002 16:17:46 -0000 1.4
+++ resource.properties 24 Sep 2002 20:29:18 -0000 1.5
@@ -1024,3 +1024,5 @@
unabletoDeployTypemapping00=Unable to deploy typemapping: {0}
badWSDDOperation=Couldn''t find a matching Java operation for WSDD operation "{0}"
({1} args)
+
+unmatchedOp=Binding operation has no corresponding portType operation: name = {0},
input name = {1}, output name = {2}
1.41 +28 -11
xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
Index: SymbolTable.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- SymbolTable.java 24 Sep 2002 20:19:57 -0000 1.40
+++ SymbolTable.java 24 Sep 2002 20:29:18 -0000 1.41
@@ -71,7 +71,9 @@
import javax.wsdl.Binding;
import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
import javax.wsdl.Definition;
import javax.wsdl.Fault;
import javax.wsdl.Import;
@@ -1491,23 +1493,38 @@
List bindList = binding.getBindingOperations();
Map mimeTypes = new HashMap();
for (Iterator opIterator = bindList.iterator(); opIterator.hasNext();) {
+ BindingOperation bindOp = (BindingOperation) opIterator.next();
+ BindingInput bindingInput = bindOp.getBindingInput();
+ BindingOutput bindingOutput = bindOp.getBindingOutput();
+ String opName = bindOp.getName();
+
+ // First, make sure the binding operation matches a portType
operation
+ String inputName = bindingInput == null ? null :
+ bindingInput.getName();
+ String outputName = bindingOutput == null ? null :
+ bindingOutput.getName();
+ if (binding.getPortType().getOperation(
+ opName, inputName, outputName) == null) {
+ throw new IOException(Messages.getMessage("unmatchedOp",
+ new String[] {opName, inputName, outputName}));
+ }
+
int inputBodyType = BindingEntry.USE_ENCODED;
int outputBodyType = BindingEntry.USE_ENCODED;
- BindingOperation bindOp = (BindingOperation) opIterator.next();
Map opMimeTypes = new HashMap();
- mimeTypes.put(bindOp.getName(), opMimeTypes);
+ mimeTypes.put(opName, opMimeTypes);
// input
- if (bindOp.getBindingInput() != null) {
- if (bindOp.getBindingInput().getExtensibilityElements() !=
null) {
- Iterator inIter =
bindOp.getBindingInput().getExtensibilityElements().iterator();
+ if (bindingInput != null) {
+ if (bindingInput.getExtensibilityElements() != null) {
+ Iterator inIter =
bindingInput.getExtensibilityElements().iterator();
for (; inIter.hasNext();) {
Object obj = inIter.next();
if (obj instanceof SOAPBody) {
String use = ((SOAPBody) obj).getUse();
if (use == null) {
throw new IOException(Messages.getMessage(
- "noUse", bindOp.getName()));
+ "noUse", opName));
}
if (use.equalsIgnoreCase("literal")) {
inputBodyType = BindingEntry.USE_LITERAL;
@@ -1525,16 +1542,16 @@
}
// output
- if (bindOp.getBindingOutput() != null) {
- if (bindOp.getBindingOutput().getExtensibilityElements() !=
null) {
- Iterator outIter =
bindOp.getBindingOutput().getExtensibilityElements().iterator();
+ if (bindingOutput != null) {
+ if (bindingOutput.getExtensibilityElements() != null) {
+ Iterator outIter =
bindingOutput.getExtensibilityElements().iterator();
for (; outIter.hasNext();) {
Object obj = outIter.next();
if (obj instanceof SOAPBody) {
String use = ((SOAPBody) obj).getUse();
if (use == null) {
throw new IOException(Messages.getMessage(
- "noUse", bindOp.getName()));
+ "noUse", opName));
}
if (use.equalsIgnoreCase("literal")) {
outputBodyType = BindingEntry.USE_LITERAL;
@@ -1569,7 +1586,7 @@
String use = ((SOAPBody) obj).getUse();
if (use == null) {
throw new IOException(Messages.getMessage(
- "noUse", bindOp.getName()));
+ "noUse", opName));
}
if (use.equalsIgnoreCase("literal")) {
faultBodyType = BindingEntry.USE_LITERAL;