1.1 --- a/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java Thu Apr 04 19:05:24 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java Tue Apr 09 14:51:13 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -26,6 +26,7 @@ 1.11 package com.sun.tools.internal.ws.processor.modeler.wsdl; 1.12 1.13 import com.sun.codemodel.internal.JType; 1.14 +import com.sun.istack.internal.NotNull; 1.15 import com.sun.istack.internal.SAXParseException2; 1.16 import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible; 1.17 import com.sun.tools.internal.ws.processor.generator.Names; 1.18 @@ -54,7 +55,6 @@ 1.19 import com.sun.tools.internal.xjc.api.S2JJAXBModel; 1.20 import com.sun.tools.internal.xjc.api.TypeAndAnnotation; 1.21 import com.sun.tools.internal.xjc.api.XJC; 1.22 -import com.sun.xml.internal.ws.spi.db.BindingContext; 1.23 import com.sun.xml.internal.ws.spi.db.BindingHelper; 1.24 import com.sun.xml.internal.ws.util.xml.XmlUtil; 1.25 import org.xml.sax.InputSource; 1.26 @@ -95,10 +95,12 @@ 1.27 1.28 private JAXBModelBuilder jaxbModelBuilder; 1.29 1.30 + @Override 1.31 public Model buildModel() { 1.32 try { 1.33 parser = new WSDLParser(options, errReceiver, forest); 1.34 parser.addParserListener(new ParserListener() { 1.35 + @Override 1.36 public void ignoringExtension(Entity entity, QName name, QName parent) { 1.37 if (parent.equals(WSDLConstants.QNAME_TYPES)) { 1.38 // check for a schema element with the wrong namespace URI 1.39 @@ -110,23 +112,27 @@ 1.40 1.41 } 1.42 1.43 + @Override 1.44 public void doneParsingEntity(QName element, Entity entity) { 1.45 } 1.46 }); 1.47 1.48 document = parser.parse(); 1.49 - if (document == null || document.getDefinitions() == null) 1.50 + if (document == null || document.getDefinitions() == null) { 1.51 return null; 1.52 + } 1.53 1.54 document.validateLocally(); 1.55 Model model = internalBuildModel(document); 1.56 - if(model == null || errReceiver.hadError()) 1.57 + if (model == null || errReceiver.hadError()) { 1.58 return null; 1.59 + } 1.60 //ClassNameCollector classNameCollector = new ClassNameCollector(); 1.61 classNameCollector.process(model); 1.62 if (classNameCollector.getConflictingClassNames().isEmpty()) { 1.63 - if(errReceiver.hadError()) 1.64 + if (errReceiver.hadError()) { 1.65 return null; 1.66 + } 1.67 return model; 1.68 } 1.69 // do another pass, this time with conflict resolution enabled 1.70 @@ -135,12 +141,13 @@ 1.71 classNameCollector.process(model); 1.72 if (classNameCollector.getConflictingClassNames().isEmpty()) { 1.73 // we're done 1.74 - if(errReceiver.hadError()) 1.75 + if (errReceiver.hadError()) { 1.76 return null; 1.77 + } 1.78 return model; 1.79 } 1.80 // give up 1.81 - StringBuffer conflictList = new StringBuffer(); 1.82 + StringBuilder conflictList = new StringBuilder(); 1.83 boolean first = true; 1.84 for (Iterator iter = 1.85 classNameCollector.getConflictingClassNames().iterator(); 1.86 @@ -208,7 +215,6 @@ 1.87 ) { 1.88 processService((com.sun.tools.internal.ws.wsdl.document.Service) iter.next(), 1.89 model, document); 1.90 - hasServices = true; 1.91 } 1.92 } else { 1.93 // emit a warning if there are no service definitions 1.94 @@ -276,8 +282,9 @@ 1.95 return false; 1.96 } 1.97 } 1.98 - if(soapAddress != null) 1.99 + if (soapAddress != null) { 1.100 port.setAddress(soapAddress.getLocation()); 1.101 + } 1.102 Binding binding = wsdlPort.resolveBinding(document); 1.103 QName bindingName = getQNameOf(binding); 1.104 PortType portType = binding.resolvePortType(document); 1.105 @@ -393,7 +400,7 @@ 1.106 null; 1.107 Set operations = 1.108 portType.getOperationsNamed(bindingOperation.getName()); 1.109 - if (operations.size() == 0) { 1.110 + if (operations.isEmpty()) { 1.111 // the WSDL document is invalid 1.112 error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(bindingOperation.getName(), binding.getName())); 1.113 } else if (operations.size() == 1) { 1.114 @@ -455,9 +462,9 @@ 1.115 1.116 1.117 Operation operation; 1.118 - if(soapBinding != null) 1.119 + if (soapBinding != null) { 1.120 operation = processSOAPOperation(); 1.121 - else{ 1.122 + } else { 1.123 operation = processNonSOAPOperation(); 1.124 } 1.125 if (operation != null) { 1.126 @@ -600,19 +607,21 @@ 1.127 private void setNonSoapStyle(Message inputMessage, Message outputMessage) { 1.128 SOAPStyle style = SOAPStyle.DOCUMENT; 1.129 for(MessagePart part:inputMessage.getParts()){ 1.130 - if(part.getDescriptorKind() == SchemaKinds.XSD_TYPE) 1.131 + if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) { 1.132 style = SOAPStyle.RPC; 1.133 - else 1.134 + } else { 1.135 style = SOAPStyle.DOCUMENT; 1.136 + } 1.137 } 1.138 1.139 //check the outputMessage parts 1.140 if(outputMessage != null){ 1.141 for(MessagePart part:outputMessage.getParts()){ 1.142 - if(part.getDescriptorKind() == SchemaKinds.XSD_TYPE) 1.143 + if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) { 1.144 style = SOAPStyle.RPC; 1.145 - else 1.146 + } else { 1.147 style = SOAPStyle.DOCUMENT; 1.148 + } 1.149 } 1.150 } 1.151 info.modelPort.setStyle(style); 1.152 @@ -666,7 +675,6 @@ 1.153 } 1.154 1.155 info.operation = operation; 1.156 - info.uniqueOperationName = uniqueOperationName; 1.157 1.158 //attachment 1.159 SOAPBody soapRequestBody = getSOAPRequestBody(); 1.160 @@ -692,8 +700,9 @@ 1.161 1.162 protected Operation processLiteralSOAPOperation(StyleAndUse styleAndUse) { 1.163 //returns false if the operation name is not acceptable 1.164 - if (!applyOperationNameCustomization()) 1.165 + if (!applyOperationNameCustomization()) { 1.166 return null; 1.167 + } 1.168 1.169 boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE; 1.170 Message inputMessage = getInputMessage(); 1.171 @@ -724,9 +733,9 @@ 1.172 1.173 //ignore operation if there are more than one root part 1.174 if (!validateMimeParts(getMimeParts(info.bindingOperation.getInput())) || 1.175 - !validateMimeParts(getMimeParts(info.bindingOperation.getOutput()))) 1.176 + !validateMimeParts(getMimeParts(info.bindingOperation.getOutput()))) { 1.177 return null; 1.178 - 1.179 + } 1.180 1.181 if (!validateBodyParts(info.bindingOperation)) { 1.182 // BP 1.1 1.183 @@ -735,16 +744,18 @@ 1.184 1.185 // R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), 1.186 // only to wsdNl:part element(s) that have been defined using the type attribute. 1.187 - if (isOperationDocumentLiteral(styleAndUse)) 1.188 - if (options.isExtensionMode()) 1.189 + if (isOperationDocumentLiteral(styleAndUse)) { 1.190 + if (options.isExtensionMode()) { 1.191 warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(info.portTypeOperation.getName())); 1.192 - else 1.193 + } else { 1.194 error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_DOCLITOPERATION(info.portTypeOperation.getName())); 1.195 - else if (isOperationRpcLiteral(styleAndUse)) { 1.196 - if (options.isExtensionMode()) 1.197 + } 1.198 + } else if (isOperationRpcLiteral(styleAndUse)) { 1.199 + if (options.isExtensionMode()) { 1.200 warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(info.portTypeOperation.getName())); 1.201 - else 1.202 + } else { 1.203 error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_RPCLITOPERATION(info.portTypeOperation.getName())); 1.204 + } 1.205 } 1.206 return null; 1.207 } 1.208 @@ -753,8 +764,9 @@ 1.209 List<MessagePart> parameterList = getParameterOrder(); 1.210 1.211 //binding is invalid in the wsdl, ignore the operation. 1.212 - if (!setMessagePartsBinding(styleAndUse)) 1.213 + if (!setMessagePartsBinding(styleAndUse)) { 1.214 return null; 1.215 + } 1.216 1.217 List<Parameter> params = null; 1.218 boolean unwrappable = isUnwrappable(); 1.219 @@ -902,13 +914,15 @@ 1.220 1.221 1.222 private boolean validateParameterName(List<Parameter> params) { 1.223 - if (options.isExtensionMode()) 1.224 + if (options.isExtensionMode()) { 1.225 return true; 1.226 + } 1.227 1.228 Message msg = getInputMessage(); 1.229 for (Parameter param : params) { 1.230 - if (param.isOUT()) 1.231 + if (param.isOUT()) { 1.232 continue; 1.233 + } 1.234 if (param.getCustomName() != null) { 1.235 if (Names.isJavaReservedWord(param.getCustomName())) { 1.236 error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName())); 1.237 @@ -935,8 +949,9 @@ 1.238 if (isRequestResponse) { 1.239 msg = getOutputMessage(); 1.240 for (Parameter param : params) { 1.241 - if (param.isIN()) 1.242 + if (param.isIN()) { 1.243 continue; 1.244 + } 1.245 if (param.getCustomName() != null) { 1.246 if (Names.isJavaReservedWord(param.getCustomName())) { 1.247 error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName())); 1.248 @@ -946,15 +961,17 @@ 1.249 } 1.250 //process doclit wrapper style 1.251 if (param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)) { 1.252 - if (param.isReturn()) 1.253 + if (param.isReturn()) { 1.254 continue; 1.255 + } 1.256 if (!param.getName().equals("return") && Names.isJavaReservedWord(param.getName())) { 1.257 error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(info.operation.getName(), param.getName(), param.getBlock().getName())); 1.258 return false; 1.259 } 1.260 } else { 1.261 - if (param.isReturn()) 1.262 + if (param.isReturn()) { 1.263 continue; 1.264 + } 1.265 1.266 //non-wrapper style and rpclit 1.267 if (Names.isJavaReservedWord(param.getName())) { 1.268 @@ -972,21 +989,24 @@ 1.269 //first we look at binding operation 1.270 JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.bindingOperation, JAXWSBinding.class); 1.271 Boolean mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null; 1.272 - if (mimeContentMapping != null) 1.273 + if (mimeContentMapping != null) { 1.274 return mimeContentMapping; 1.275 + } 1.276 1.277 //then in wsdl:binding 1.278 Binding binding = info.port.resolveBinding(info.document); 1.279 jaxwsCustomization = (JAXWSBinding) getExtensionOfType(binding, JAXWSBinding.class); 1.280 mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null; 1.281 - if (mimeContentMapping != null) 1.282 + if (mimeContentMapping != null) { 1.283 return mimeContentMapping; 1.284 + } 1.285 1.286 //at last look in wsdl:definitions 1.287 jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.document.getDefinitions(), JAXWSBinding.class); 1.288 mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null; 1.289 - if (mimeContentMapping != null) 1.290 + if (mimeContentMapping != null) { 1.291 return mimeContentMapping; 1.292 + } 1.293 return false; 1.294 } 1.295 1.296 @@ -995,10 +1015,11 @@ 1.297 String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null; 1.298 if (operationName != null) { 1.299 if (Names.isJavaReservedWord(operationName)) { 1.300 - if (options.isExtensionMode()) 1.301 + if (options.isExtensionMode()) { 1.302 warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName)); 1.303 - else 1.304 + } else { 1.305 error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName)); 1.306 + } 1.307 return false; 1.308 } 1.309 1.310 @@ -1006,10 +1027,11 @@ 1.311 } 1.312 1.313 if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) { 1.314 - if (options.isExtensionMode()) 1.315 + if (options.isExtensionMode()) { 1.316 warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName())); 1.317 - else 1.318 + } else { 1.319 error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName())); 1.320 + } 1.321 return false; 1.322 } 1.323 return true; 1.324 @@ -1017,8 +1039,9 @@ 1.325 1.326 protected String getAsyncOperationName(Operation operation) { 1.327 String name = operation.getCustomizedName(); 1.328 - if (name == null) 1.329 + if (name == null) { 1.330 name = operation.getUniqueName(); 1.331 + } 1.332 return name; 1.333 } 1.334 1.335 @@ -1027,28 +1050,32 @@ 1.336 */ 1.337 private void addAsyncOperations(Operation syncOperation, StyleAndUse styleAndUse) { 1.338 Operation operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.POLLING); 1.339 - if (operation != null) 1.340 + if (operation != null) { 1.341 info.modelPort.addOperation(operation); 1.342 + } 1.343 1.344 operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.CALLBACK); 1.345 - if (operation != null) 1.346 + if (operation != null) { 1.347 info.modelPort.addOperation(operation); 1.348 + } 1.349 } 1.350 1.351 private Operation createAsyncOperation(Operation syncOperation, StyleAndUse styleAndUse, AsyncOperationType asyncType) { 1.352 boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE; 1.353 - if (!isRequestResponse) 1.354 + if (!isRequestResponse) { 1.355 return null; 1.356 + } 1.357 1.358 //create async operations 1.359 AsyncOperation operation = new AsyncOperation(info.operation, info.bindingOperation); 1.360 1.361 //creation the async operation name: operationName+Async or customized name 1.362 //operation.setName(new QName(operation.getName().getNamespaceURI(), getAsyncOperationName(info.portTypeOperation, operation))); 1.363 - if (asyncType.equals(AsyncOperationType.CALLBACK)) 1.364 + if (asyncType.equals(AsyncOperationType.CALLBACK)) { 1.365 operation.setUniqueName(info.operation.getUniqueName() + "_async_callback"); 1.366 - else if (asyncType.equals(AsyncOperationType.POLLING)) 1.367 + } else if (asyncType.equals(AsyncOperationType.POLLING)) { 1.368 operation.setUniqueName(info.operation.getUniqueName() + "_async_polling"); 1.369 + } 1.370 1.371 setDocumentationIfPresent( 1.372 operation, 1.373 @@ -1149,7 +1176,7 @@ 1.374 //create response bean 1.375 String nspace = ""; 1.376 QName responseBeanName = new QName(nspace, getAsyncOperationName(info.operation) + "Response"); 1.377 - JAXBType responseBeanType = jaxbModelBuilder.getJAXBType(responseBeanName); 1.378 + JAXBType responseBeanType = getJAXBModelBuilder().getJAXBType(responseBeanName); 1.379 if (responseBeanType == null) { 1.380 error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_RESPONSEBEAN_NOTFOUND(info.operation.getName())); 1.381 } 1.382 @@ -1166,20 +1193,19 @@ 1.383 operation.setProperty(WSDL_RESULT_PARAMETER, respParam.getName()); 1.384 1.385 1.386 - List<String> definitiveParameterList = new ArrayList<String>(); 1.387 int parameterOrderPosition = 0; 1.388 for (String name : parameterList) { 1.389 Parameter inParameter = ModelerUtils.getParameter(name, inParameters); 1.390 if (inParameter == null) { 1.391 - if (options.isExtensionMode()) 1.392 + if (options.isExtensionMode()) { 1.393 warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name)); 1.394 - else 1.395 + } else { 1.396 error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_ERROR_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name)); 1.397 + } 1.398 return null; 1.399 } 1.400 request.addParameter(inParameter); 1.401 inParameter.setParameterIndex(parameterOrderPosition); 1.402 - definitiveParameterList.add(name); 1.403 parameterOrderPosition++; 1.404 } 1.405 1.406 @@ -1203,25 +1229,27 @@ 1.407 JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(wsdlOperation, JAXWSBinding.class); 1.408 Boolean isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null; 1.409 1.410 - if (isAsync != null) 1.411 + if (isAsync != null) { 1.412 return isAsync; 1.413 + } 1.414 1.415 // then into wsdl:portType 1.416 - QName portTypeName = new QName(portType.getDefining().getTargetNamespaceURI(), portType.getName()); 1.417 jaxwsCustomization = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class); 1.418 isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null; 1.419 - if (isAsync != null) 1.420 + if (isAsync != null) { 1.421 return isAsync; 1.422 + } 1.423 1.424 //then wsdl:definitions 1.425 jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class); 1.426 isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null; 1.427 - if (isAsync != null) 1.428 + if (isAsync != null) { 1.429 return isAsync; 1.430 + } 1.431 return false; 1.432 } 1.433 1.434 - protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, List<String> definitiveParameterList, boolean processRequest) { 1.435 + protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, @NotNull List<String> definitiveParameterList, boolean processRequest) { 1.436 QName headerName; 1.437 Block headerBlock; 1.438 JAXBType jaxbType; 1.439 @@ -1248,25 +1276,21 @@ 1.440 Parameter parameter = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock); 1.441 parameter.setParameterIndex(parameterOrderPosition); 1.442 setCustomizedParameterName(info.bindingOperation, headerMessage, part, parameter, false); 1.443 - if (processRequest && definitiveParameterList != null) { 1.444 + if (processRequest) { 1.445 request.addParameter(parameter); 1.446 definitiveParameterList.add(parameter.getName()); 1.447 } else { 1.448 - if (definitiveParameterList != null) { 1.449 - for (Iterator iterInParams = definitiveParameterList.iterator(); iterInParams.hasNext();) { 1.450 - String inParamName = 1.451 - (String) iterInParams.next(); 1.452 - if (inParamName.equals(parameter.getName())) { 1.453 - Parameter inParam = request.getParameterByName(inParamName); 1.454 - parameter.setLinkedParameter(inParam); 1.455 - inParam.setLinkedParameter(parameter); 1.456 - //its in/out parameter, input and output parameter have the same order position. 1.457 - parameter.setParameterIndex(inParam.getParameterIndex()); 1.458 - } 1.459 + for (String inParamName : definitiveParameterList) { 1.460 + if (inParamName.equals(parameter.getName())) { 1.461 + Parameter inParam = request.getParameterByName(inParamName); 1.462 + parameter.setLinkedParameter(inParam); 1.463 + inParam.setLinkedParameter(parameter); 1.464 + //its in/out parameter, input and output parameter have the same order position. 1.465 + parameter.setParameterIndex(inParam.getParameterIndex()); 1.466 } 1.467 - if (!definitiveParameterList.contains(parameter.getName())) { 1.468 - definitiveParameterList.add(parameter.getName()); 1.469 - } 1.470 + } 1.471 + if (!definitiveParameterList.contains(parameter.getName())) { 1.472 + definitiveParameterList.add(parameter.getName()); 1.473 } 1.474 response.addParameter(parameter); 1.475 } 1.476 @@ -1311,7 +1335,6 @@ 1.477 Fault fault = new Fault(faultName, portTypeFault); 1.478 fault.setWsdlFaultName(portTypeFault.getName()); 1.479 setDocumentationIfPresent(fault, portTypeFault.getDocumentation()); 1.480 - String faultNamespaceURI = null; 1.481 if (bindingFault != null) { 1.482 //get the soapbind:fault from wsdl:fault in the binding 1.483 SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class); 1.484 @@ -1328,10 +1351,11 @@ 1.485 1.486 //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal" 1.487 if (!soapFault.isLiteral()) { 1.488 - if (options.isExtensionMode()) 1.489 + if (options.isExtensionMode()) { 1.490 warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName())); 1.491 - else 1.492 + } else { 1.493 error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName())); 1.494 + } 1.495 continue; 1.496 } 1.497 1.498 @@ -1344,10 +1368,6 @@ 1.499 warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName())); 1.500 } 1.501 1.502 - faultNamespaceURI = soapFault.getNamespace(); 1.503 - } 1.504 - if (faultNamespaceURI == null) { 1.505 - faultNamespaceURI = portTypeFault.getMessage().getNamespaceURI(); 1.506 } 1.507 1.508 com.sun.tools.internal.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document); 1.509 @@ -1371,7 +1391,11 @@ 1.510 } 1.511 1.512 if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) { 1.513 - error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName())); 1.514 + if (options.isExtensionMode()) { 1.515 + warning(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName())); 1.516 + } else { 1.517 + error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName())); 1.518 + } 1.519 } 1.520 1.521 JAXBType jaxbType = getJAXBType(faultPart); 1.522 @@ -1383,8 +1407,9 @@ 1.523 fault.setBlock(faultBlock); 1.524 //createParentFault(fault); 1.525 //createSubfaults(fault); 1.526 - if (!response.getFaultBlocksMap().containsKey(faultBlock.getName())) 1.527 + if (!response.getFaultBlocksMap().containsKey(faultBlock.getName())) { 1.528 response.addFaultBlock(faultBlock); 1.529 + } 1.530 info.operation.addFault(fault); 1.531 } 1.532 } 1.533 @@ -1403,21 +1428,22 @@ 1.534 protected boolean setMessagePartsBinding(StyleAndUse styleAndUse) { 1.535 SOAPBody inBody = getSOAPRequestBody(); 1.536 Message inMessage = getInputMessage(); 1.537 - if (!setMessagePartsBinding(inBody, inMessage, styleAndUse, true)) 1.538 + if (!setMessagePartsBinding(inBody, inMessage, styleAndUse, true)) { 1.539 return false; 1.540 + } 1.541 1.542 if (isRequestResponse()) { 1.543 SOAPBody outBody = getSOAPResponseBody(); 1.544 Message outMessage = getOutputMessage(); 1.545 - if (!setMessagePartsBinding(outBody, outMessage, styleAndUse, false)) 1.546 + if (!setMessagePartsBinding(outBody, outMessage, styleAndUse, false)) { 1.547 return false; 1.548 + } 1.549 } 1.550 return true; 1.551 } 1.552 1.553 //returns false if the wsdl is invalid and operation should be ignored 1.554 protected boolean setMessagePartsBinding(SOAPBody body, Message message, StyleAndUse styleAndUse, boolean isInput) { 1.555 - List<MessagePart> parts = new ArrayList<MessagePart>(); 1.556 1.557 //get Mime parts 1.558 List<MessagePart> mimeParts; 1.559 @@ -1448,10 +1474,11 @@ 1.560 if (mimeParts.contains(mPart) || headerParts.contains(mPart) || boundToFault(mPart.getName())) { 1.561 //throw error that a part cant be bound multiple times, not ignoring operation, if there 1.562 //is conflict it will fail latter 1.563 - if (options.isExtensionMode()) 1.564 + if (options.isExtensionMode()) { 1.565 warning(mPart, ModelerMessages.WSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName())); 1.566 - else 1.567 + } else { 1.568 error(mPart, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName())); 1.569 + } 1.570 } 1.571 bodyParts.add(mPart); 1.572 } 1.573 @@ -1462,23 +1489,21 @@ 1.574 MessagePart mPart = (MessagePart) iter.next(); 1.575 if (mimeParts.contains(mPart)) { 1.576 mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING); 1.577 - parts.add(mPart); 1.578 } else if (headerParts.contains(mPart)) { 1.579 mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING); 1.580 - parts.add(mPart); 1.581 } else if (bodyParts.contains(mPart)) { 1.582 mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING); 1.583 - parts.add(mPart); 1.584 } else { 1.585 mPart.setBindingExtensibilityElementKind(MessagePart.PART_NOT_BOUNDED); 1.586 } 1.587 } 1.588 1.589 if (isOperationDocumentLiteral(styleAndUse) && bodyParts.size() > 1) { 1.590 - if (options.isExtensionMode()) 1.591 + if (options.isExtensionMode()) { 1.592 warning(message, ModelerMessages.WSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName())); 1.593 - else 1.594 + } else { 1.595 error(message, ModelerMessages.WSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName())); 1.596 + } 1.597 return false; 1.598 } 1.599 return true; 1.600 @@ -1486,8 +1511,9 @@ 1.601 1.602 private boolean boundToFault(String partName) { 1.603 for (BindingFault bindingFault : info.bindingOperation.faults()) { 1.604 - if (partName.equals(bindingFault.getName())) 1.605 + if (partName.equals(bindingFault.getName())) { 1.606 return true; 1.607 + } 1.608 } 1.609 return false; 1.610 } 1.611 @@ -1518,8 +1544,9 @@ 1.612 List<MessagePart> headers = getHeaderParts(bindingOperation, isInput); 1.613 1.614 for(MessagePart part: headers){ 1.615 - if(parts.contains(part)) 1.616 + if (parts.contains(part)) { 1.617 continue; 1.618 + } 1.619 headerParts.add(part); 1.620 } 1.621 return headerParts; 1.622 @@ -1542,15 +1569,18 @@ 1.623 Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator(); 1.624 while (headers.hasNext()) { 1.625 SOAPHeader header = headers.next(); 1.626 - if (!header.isLiteral()) 1.627 + if (!header.isLiteral()) { 1.628 continue; 1.629 + } 1.630 com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(), document); 1.631 - if (headerMessage == null) 1.632 + if (headerMessage == null) { 1.633 continue; 1.634 + } 1.635 1.636 MessagePart headerPart = headerMessage.getPart(header.getPart()); 1.637 - if (headerPart == part) 1.638 + if (headerPart == part) { 1.639 return headerMessage; 1.640 + } 1.641 } 1.642 return null; 1.643 } 1.644 @@ -1584,7 +1614,11 @@ 1.645 error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName())); 1.646 } 1.647 if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) { 1.648 - error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); 1.649 + if (options.isExtensionMode()) { 1.650 + warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); 1.651 + } else { 1.652 + error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); 1.653 + } 1.654 } 1.655 part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING); 1.656 parts.add(part); 1.657 @@ -1608,7 +1642,7 @@ 1.658 JAXBType type; 1.659 QName name = part.getDescriptor(); 1.660 if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) { 1.661 - type = jaxbModelBuilder.getJAXBType(name); 1.662 + type = getJAXBModelBuilder().getJAXBType(name); 1.663 if(type == null){ 1.664 error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName())); 1.665 } 1.666 @@ -1625,8 +1659,9 @@ 1.667 } 1.668 1.669 private List<Parameter> getDoclitParameters(Request req, Response res, List<MessagePart> parameterList) { 1.670 - if (parameterList.size() == 0) 1.671 + if (parameterList.isEmpty()) { 1.672 return new ArrayList<Parameter>(); 1.673 + } 1.674 List<Parameter> params = new ArrayList<Parameter>(); 1.675 Message inMsg = getInputMessage(); 1.676 Message outMsg = getOutputMessage(); 1.677 @@ -1651,15 +1686,14 @@ 1.678 res.addBodyBlock(block); 1.679 } 1.680 } else if (ModelerUtils.isUnbound(part)) { 1.681 - if (part.isIN()) 1.682 + if (part.isIN()) { 1.683 req.addUnboundBlock(block); 1.684 - else if (part.isOUT()) 1.685 + } else if (part.isOUT()) { 1.686 res.addUnboundBlock(block); 1.687 - else if (part.isINOUT()) { 1.688 + } else if (part.isINOUT()) { 1.689 req.addUnboundBlock(block); 1.690 res.addUnboundBlock(block); 1.691 } 1.692 - 1.693 } 1.694 if (part.isIN() || part.isINOUT()) { 1.695 params = ModelerUtils.createUnwrappedParameters(jaxbStructType, block); 1.696 @@ -1756,10 +1790,11 @@ 1.697 param.setParameterIndex(pIndex++); 1.698 } 1.699 1.700 - if (part.isIN()) 1.701 + if (part.isIN()) { 1.702 setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, false); 1.703 - else if (outMsg != null) 1.704 + } else if (outMsg != null) { 1.705 setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, false); 1.706 + } 1.707 1.708 params.add(param); 1.709 } 1.710 @@ -1807,8 +1842,9 @@ 1.711 S2JJAXBModel jaxbModel = ((RpcLitStructure) reqBlock.getType()).getJaxbModel().getS2JJAXBModel(); 1.712 List<Parameter> inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel, errReceiver); 1.713 List<Parameter> outParams = null; 1.714 - if (outMsg != null) 1.715 + if (outMsg != null) { 1.716 outParams = ModelerUtils.createRpcLitParameters(outMsg, resBlock, jaxbModel, errReceiver); 1.717 + } 1.718 1.719 //create parameters for header and mime parts 1.720 int index = 0; 1.721 @@ -1835,12 +1871,13 @@ 1.722 } 1.723 } else if (ModelerUtils.isBoundToMimeContent(part)) { 1.724 List<MIMEContent> mimeContents; 1.725 - if (part.isIN() || part.isINOUT()) 1.726 + if (part.isIN() || part.isINOUT()) { 1.727 mimeContents = getMimeContents(info.bindingOperation.getInput(), 1.728 getInputMessage(), part.getName()); 1.729 - else 1.730 + } else { 1.731 mimeContents = getMimeContents(info.bindingOperation.getOutput(), 1.732 getOutputMessage(), part.getName()); 1.733 + } 1.734 1.735 JAXBType type = getAttachmentType(mimeContents, part); 1.736 //create Parameters in request or response 1.737 @@ -1892,10 +1929,11 @@ 1.738 } 1.739 } 1.740 for (Parameter param : params) { 1.741 - if (param.isIN()) 1.742 + if (param.isIN()) { 1.743 setCustomizedParameterName(info.portTypeOperation, inMsg, inMsg.getPart(param.getName()), param, false); 1.744 - else if (outMsg != null) 1.745 + } else if (outMsg != null) { 1.746 setCustomizedParameterName(info.portTypeOperation, outMsg, outMsg.getPart(param.getName()), param, false); 1.747 + } 1.748 } 1.749 return params; 1.750 } 1.751 @@ -1903,8 +1941,9 @@ 1.752 private List<Parameter> getRequestParameters(Request request, List<String> parameterList) { 1.753 Message inputMessage = getInputMessage(); 1.754 //there is no input message, return zero parameters 1.755 - if (inputMessage != null && !inputMessage.parts().hasNext()) 1.756 + if (inputMessage != null && !inputMessage.parts().hasNext()) { 1.757 return new ArrayList<Parameter>(); 1.758 + } 1.759 1.760 List<Parameter> inParameters = null; 1.761 QName reqBodyName; 1.762 @@ -1915,8 +1954,9 @@ 1.763 //setup request parameters 1.764 for (String inParamName : parameterList) { 1.765 MessagePart part = inputMessage.getPart(inParamName); 1.766 - if (part == null) 1.767 + if (part == null) { 1.768 continue; 1.769 + } 1.770 reqBodyName = part.getDescriptor(); 1.771 jaxbReqType = getJAXBType(part); 1.772 if (unwrappable) { 1.773 @@ -1949,8 +1989,9 @@ 1.774 } else if (ModelerUtils.isUnbound(part)) { 1.775 request.addUnboundBlock(reqBlock); 1.776 } 1.777 - if (inParameters == null) 1.778 + if (inParameters == null) { 1.779 inParameters = new ArrayList<Parameter>(); 1.780 + } 1.781 Parameter param = ModelerUtils.createParameter(part.getName(), jaxbReqType, reqBlock); 1.782 setCustomizedParameterName(info.portTypeOperation, inputMessage, part, param, false); 1.783 inParameters.add(param); 1.784 @@ -1966,25 +2007,29 @@ 1.785 */ 1.786 private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) { 1.787 JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class); 1.788 - if (jaxwsBinding == null) 1.789 + if (jaxwsBinding == null) { 1.790 return; 1.791 + } 1.792 String paramName = part.getName(); 1.793 QName elementName = part.getDescriptor(); 1.794 - if (wrapperStyle) 1.795 + if (wrapperStyle) { 1.796 elementName = param.getType().getName(); 1.797 + } 1.798 String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle); 1.799 if (customName != null && !customName.equals("")) { 1.800 param.setCustomName(customName); 1.801 } 1.802 } 1.803 1.804 + @Override 1.805 protected boolean isConflictingPortClassName(String name) { 1.806 return false; 1.807 } 1.808 1.809 protected boolean isUnwrappable() { 1.810 - if (!getWrapperStyleCustomization()) 1.811 + if (!getWrapperStyleCustomization()) { 1.812 return false; 1.813 + } 1.814 1.815 com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage(); 1.816 com.sun.tools.internal.ws.wsdl.document.Message outputMessage = getOutputMessage(); 1.817 @@ -2006,14 +2051,16 @@ 1.818 // is equal to the operation name 1.819 // Wrapper style if the output message part refers to a global element declaration 1.820 if ((inputPart != null && !inputPart.getDescriptor().getLocalPart().equals(operationName)) || 1.821 - (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT)) 1.822 + (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT)) { 1.823 return false; 1.824 + } 1.825 1.826 //check to see if either input or output message part not bound to soapbing:body 1.827 //in that case the operation is not wrapper style 1.828 if (((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) || 1.829 - ((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING))) 1.830 + ((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING))) { 1.831 return false; 1.832 + } 1.833 1.834 // Wrapper style if the elements referred to by the input and output message parts 1.835 // (henceforth referred to as wrapper elements) are both complex types defined 1.836 @@ -2034,8 +2081,9 @@ 1.837 return inputWrappable; 1.838 } 1.839 JAXBType outputType = getJAXBType(outputPart); 1.840 - if ((inputType != null) && (outputType != null)) 1.841 + if ((inputType != null) && (outputType != null)) { 1.842 return inputType.isUnwrappable() && outputType.isUnwrappable(); 1.843 + } 1.844 } 1.845 1.846 return false; 1.847 @@ -2047,8 +2095,9 @@ 1.848 JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeOperation, JAXWSBinding.class); 1.849 if (jaxwsBinding != null) { 1.850 Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle(); 1.851 - if (isWrappable != null) 1.852 + if (isWrappable != null) { 1.853 return isWrappable; 1.854 + } 1.855 } 1.856 1.857 //then into wsdl:portType 1.858 @@ -2056,16 +2105,18 @@ 1.859 jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class); 1.860 if (jaxwsBinding != null) { 1.861 Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle(); 1.862 - if (isWrappable != null) 1.863 + if (isWrappable != null) { 1.864 return isWrappable; 1.865 + } 1.866 } 1.867 1.868 //then wsdl:definitions 1.869 jaxwsBinding = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class); 1.870 if (jaxwsBinding != null) { 1.871 Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle(); 1.872 - if (isWrappable != null) 1.873 + if (isWrappable != null) { 1.874 return isWrappable; 1.875 + } 1.876 } 1.877 return true; 1.878 } 1.879 @@ -2083,8 +2134,9 @@ 1.880 Iterator iter = getInputMessage().parts(); 1.881 while (iter.hasNext()) { 1.882 MessagePart part = (MessagePart) iter.next(); 1.883 - if (outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor())) 1.884 + if (outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor())) { 1.885 return true; 1.886 + } 1.887 } 1.888 } else if (soapOperation != null && soapOperation.isRPC() || info.soapBinding.isRPC()) { 1.889 com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage(); 1.890 @@ -2105,11 +2157,13 @@ 1.891 //create parameters for header and mime parts 1.892 for (String paramName : parameterList) { 1.893 MessagePart part = message.getPart(paramName); 1.894 - if (part == null) 1.895 + if (part == null) { 1.896 continue; 1.897 + } 1.898 if (ModelerUtils.isBoundToSOAPHeader(part)) { 1.899 - if (parameters == null) 1.900 + if (parameters == null) { 1.901 parameters = new ArrayList<Parameter>(); 1.902 + } 1.903 QName headerName = part.getDescriptor(); 1.904 JAXBType jaxbType = getJAXBType(part); 1.905 Block headerBlock = new Block(headerName, jaxbType, part); 1.906 @@ -2119,8 +2173,9 @@ 1.907 parameters.add(param); 1.908 } 1.909 } else if (ModelerUtils.isBoundToMimeContent(part)) { 1.910 - if (parameters == null) 1.911 + if (parameters == null) { 1.912 parameters = new ArrayList<Parameter>(); 1.913 + } 1.914 List<MIMEContent> mimeContents = getMimeContents(info.bindingOperation.getInput(), 1.915 getInputMessage(), paramName); 1.916 1.917 @@ -2134,8 +2189,9 @@ 1.918 parameters.add(param); 1.919 } 1.920 } else if (ModelerUtils.isUnbound(part)) { 1.921 - if (parameters == null) 1.922 + if (parameters == null) { 1.923 parameters = new ArrayList<Parameter>(); 1.924 + } 1.925 QName name = part.getDescriptor(); 1.926 JAXBType type = getJAXBType(part); 1.927 Block unboundBlock = new Block(name, type, part); 1.928 @@ -2186,10 +2242,8 @@ 1.929 if(typeAnno == null){ 1.930 error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(part.getDescriptor(), part.getName())); 1.931 } 1.932 - for (Iterator mimeTypeIter = mimeTypes.iterator(); mimeTypeIter.hasNext();) { 1.933 - String mimeType = (String) mimeTypeIter.next(); 1.934 - if ((!mimeType.equals("text/xml") && 1.935 - !mimeType.equals("application/xml"))) { 1.936 + for (String mimeType : mimeTypes) { 1.937 + if ((!mimeType.equals("text/xml") && !mimeType.equals("application/xml"))) { 1.938 //According to AP 1.0, 1.939 //RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a 1.940 //global element declaration (via the element attribute of the wsdl:part 1.941 @@ -2210,13 +2264,13 @@ 1.942 } 1.943 1.944 protected void buildJAXBModel(WSDLDocument wsdlDocument) { 1.945 - JAXBModelBuilder jaxbModelBuilder = new JAXBModelBuilder(options, classNameCollector, forest, errReceiver); 1.946 + JAXBModelBuilder tempJaxbModelBuilder = new JAXBModelBuilder(options, classNameCollector, forest, errReceiver); 1.947 //set the java package where wsdl artifacts will be generated 1.948 //if user provided package name using -p switch (or package property on wsimport ant task) 1.949 //ignore the package customization in the wsdl and schema bidnings 1.950 //formce the -p option only in the first pass 1.951 if (explicitDefaultPackage != null) { 1.952 - jaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(options.defaultPackage); 1.953 + tempJaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(options.defaultPackage); 1.954 } else { 1.955 options.defaultPackage = getJavaPackage(); 1.956 } 1.957 @@ -2224,10 +2278,10 @@ 1.958 //create pseudo schema for async operations(if any) response bean 1.959 List<InputSource> schemas = PseudoSchemaBuilder.build(this, options, errReceiver); 1.960 for (InputSource schema : schemas) { 1.961 - jaxbModelBuilder.getJAXBSchemaCompiler().parseSchema(schema); 1.962 + tempJaxbModelBuilder.getJAXBSchemaCompiler().parseSchema(schema); 1.963 } 1.964 - jaxbModelBuilder.bind(); 1.965 - this.jaxbModelBuilder = jaxbModelBuilder; 1.966 + tempJaxbModelBuilder.bind(); 1.967 + this.jaxbModelBuilder = tempJaxbModelBuilder; 1.968 } 1.969 1.970 protected String getJavaPackage() { 1.971 @@ -2270,8 +2324,9 @@ 1.972 1.973 for (JavaParameter jParam : operation.getJavaMethod().getParametersList()) { 1.974 Parameter param = jParam.getParameter(); 1.975 - if (param.getCustomName() != null) 1.976 + if (param.getCustomName() != null) { 1.977 jParam.setName(param.getCustomName()); 1.978 + } 1.979 } 1.980 } 1.981 1.982 @@ -2283,8 +2338,9 @@ 1.983 JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(wsdlService, JAXWSBinding.class); 1.984 if (jaxwsCust != null && jaxwsCust.getClassName() != null) { 1.985 CustomName name = jaxwsCust.getClassName(); 1.986 - if (name != null && !name.getName().equals("")) 1.987 + if (name != null && !name.getName().equals("")) { 1.988 return makePackageQualified(name.getName()); 1.989 + } 1.990 } 1.991 return makePackageQualified(BindingHelper.mangleNameToClassName(serviceName)); 1.992 } 1.993 @@ -2323,28 +2379,13 @@ 1.994 JavaInterface intf) { 1.995 String candidateName = getJavaNameForOperation(operation); 1.996 JavaMethod method = new JavaMethod(candidateName, options, errReceiver); 1.997 - Request request = operation.getRequest(); 1.998 - Iterator requestBodyBlocks = request.getBodyBlocks(); 1.999 - Block requestBlock = 1.1000 - (requestBodyBlocks.hasNext() 1.1001 - ? request.getBodyBlocks().next() 1.1002 - : null); 1.1003 1.1004 + assert (operation.getRequest() != null); 1.1005 Response response = operation.getResponse(); 1.1006 - Iterator responseBodyBlocks = null; 1.1007 - Block responseBlock; 1.1008 - if (response != null) { 1.1009 - responseBodyBlocks = response.getBodyBlocks(); 1.1010 - responseBlock = 1.1011 - responseBodyBlocks.hasNext() 1.1012 - ? response.getBodyBlocks().next() 1.1013 - : null; 1.1014 - } 1.1015 1.1016 // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we 1.1017 // detect overloading conflicts in the generated java interface/classes 1.1018 - String signature = candidateName; 1.1019 - for (Iterator iter = request.getParameters(); iter.hasNext();) { 1.1020 + for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) { 1.1021 Parameter parameter = (Parameter) iter.next(); 1.1022 1.1023 if (parameter.getJavaParameter() != null) { 1.1024 @@ -2364,7 +2405,6 @@ 1.1025 method.addParameter(javaParameter); 1.1026 parameter.setJavaParameter(javaParameter); 1.1027 1.1028 - signature += "%" + parameterType.getName(); 1.1029 } 1.1030 1.1031 if (response != null) { 1.1032 @@ -2390,7 +2430,6 @@ 1.1033 } 1.1034 String candidateName = getJavaNameForOperation(operation); 1.1035 JavaMethod method = new JavaMethod(candidateName, options, errReceiver); 1.1036 - Request request = operation.getRequest(); 1.1037 Parameter returnParam = (Parameter) operation.getProperty(WSDL_RESULT_PARAMETER); 1.1038 if (returnParam != null) { 1.1039 JavaType parameterType = returnParam.getType().getJavaType(); 1.1040 @@ -2514,7 +2553,7 @@ 1.1041 protected List<MessagePart> getParameterOrder() { 1.1042 List<MessagePart> params = new ArrayList<MessagePart>(); 1.1043 String parameterOrder = info.portTypeOperation.getParameterOrder(); 1.1044 - java.util.List<String> parameterList = new ArrayList<String>(); 1.1045 + java.util.List<String> parameterList; 1.1046 boolean parameterOrderPresent = false; 1.1047 if ((parameterOrder != null) && !(parameterOrder.trim().equals(""))) { 1.1048 parameterList = XmlUtil.parseTokenList(parameterOrder); 1.1049 @@ -2636,7 +2675,6 @@ 1.1050 } 1.1051 //parameterOrder attribute is not valid, we ignore it 1.1052 warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(info.operation.getName().getLocalPart())); 1.1053 - parameterOrderPresent = false; 1.1054 parameterList.clear(); 1.1055 } 1.1056 1.1057 @@ -2660,8 +2698,9 @@ 1.1058 1.1059 //append the out parts to the parameterList 1.1060 for (MessagePart part : outParts) { 1.1061 - if (outParts.size() == 1) 1.1062 + if (outParts.size() == 1) { 1.1063 part.setReturn(true); 1.1064 + } 1.1065 params.add(part); 1.1066 } 1.1067 } 1.1068 @@ -2678,6 +2717,7 @@ 1.1069 return options.defaultPackage + "." + prefix + suffix; 1.1070 } 1.1071 1.1072 + @Override 1.1073 protected boolean isConflictingServiceClassName(String name) { 1.1074 return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name) || conflictsWithExceptionClass(name); 1.1075 } 1.1076 @@ -2697,6 +2737,7 @@ 1.1077 return exceptionNames != null && exceptionNames.contains(name); 1.1078 } 1.1079 1.1080 + @Override 1.1081 protected boolean isConflictingExceptionClassName(String name) { 1.1082 return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name); 1.1083 } 1.1084 @@ -2710,15 +2751,17 @@ 1.1085 (SOAPBinding) getExtensionOfType(binding, SOAPBinding.class); 1.1086 1.1087 //dont process the binding 1.1088 - if (soapBinding == null) 1.1089 - soapBinding = 1.1090 - (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class); 1.1091 - if (soapBinding == null) 1.1092 + if (soapBinding == null) { 1.1093 + soapBinding = (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class); 1.1094 + } 1.1095 + if (soapBinding == null) { 1.1096 return false; 1.1097 + } 1.1098 1.1099 //if soapbind:binding has no style attribute, the default is DOCUMENT 1.1100 - if (soapBinding.getStyle() == null) 1.1101 + if (soapBinding.getStyle() == null) { 1.1102 soapBinding.setStyle(SOAPStyle.DOCUMENT); 1.1103 + } 1.1104 1.1105 SOAPStyle opStyle = soapBinding.getStyle(); 1.1106 for (Iterator iter = binding.operations(); iter.hasNext();) { 1.1107 @@ -2730,8 +2773,9 @@ 1.1108 if (soapOperation != null) { 1.1109 SOAPStyle currOpStyle = (soapOperation.getStyle() != null) ? soapOperation.getStyle() : soapBinding.getStyle(); 1.1110 //dont check for the first operation 1.1111 - if (!currOpStyle.equals(opStyle)) 1.1112 + if (!currOpStyle.equals(opStyle)) { 1.1113 return false; 1.1114 + } 1.1115 } 1.1116 } 1.1117 return true;