/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* The WSDLModeler processes a WSDL to create a Model.
*
* @author WS Development Team
*/
//map of wsdl:operation QName to <soapenv:Body> child, as per BP it must be unique in a port
this.classNameCollector = new ClassNameCollector();
}
protected enum StyleAndUse {
}
try {
// check for a schema element with the wrong namespace URI
warning(entity, ModelerMessages.WSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(name.getNamespaceURI()));
}
}
}
}
});
return null;
return null;
//ClassNameCollector classNameCollector = new ClassNameCollector();
if(errReceiver.hadError())
return null;
return model;
}
// do another pass, this time with conflict resolution enabled
// we're done
if(errReceiver.hadError())
return null;
return model;
}
// give up
boolean first = true;
) {
if (!first) {
} else {
first = false;
}
}
error(document.getDefinitions(), ModelerMessages.WSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(conflictList.toString()));
} catch (ModelException e) {
} catch (ParseException e) {
errReceiver.error(e);
} catch (ValidationException e) {
} catch (SAXException e) {
errReceiver.error(e);
} catch (IOException e) {
errReceiver.error(e);
}
//should never reach here
return null;
}
numPasses++;
//build the jaxbModel to be used latter
new QName(
? "model"
// This fails with the changed classname (WSDLModeler to WSDLModeler11 etc.)
// with this source comaptibility change the WSDL Modeler class name is changed. Right now hardcoding the
// modeler class name to the same one being checked in WSDLGenerator.
_javaTypes = new JavaSimpleTypeCreator();
// grab target namespace
if (hasServices) {
) {
hasServices = true;
}
} else {
// emit a warning if there are no service definitions
}
return model;
}
/* (non-Javadoc)
* @see WSDLModelerBase#processService(Service, Model, WSDLDocument)
*/
protected void processService(com.sun.tools.internal.ws.wsdl.document.Service wsdlService, Model model, WSDLDocument document) {
serviceInterface += "_Service";
}
new Service(
boolean hasPorts = false;
boolean processed =
document);
}
if (!hasPorts) {
// emit a warning if there are no ports
warning(wsdlService, ModelerMessages.WSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(wsdlService.getName()));
} else {
}
}
/* (non-Javadoc)
* @see WSDLModelerBase#processPort(WSDLPort, Service, WSDLDocument)
*/
try {
//clear the unique block map
if (soapAddress == null) {
if(options.isExtensionMode()){
}else{
// not a SOAP port, ignore it
warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(wsdlPort.getName()));
return false;
}
}
if(soapAddress != null)
// this binding has been processed before
} else {
// find out the SOAP binding extension, if any
if (soapBinding == null) {
if (soapBinding == null) {
if(!options.isExtensionMode()){
// cannot deal with non-SOAP ports
return false;
}else{
}
}else{
// we can only do soap1.2 if extensions are on
if (options.isExtensionMode()) {
} else {
warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(wsdlPort.getName()));
return false;
}
}
}
if (!options.isExtensionMode()) {
// cannot deal with non-HTTP ports
warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(wsdlPort.getName()));
return false;
}
}
/**
* validate wsdl:binding uniqueness in style, e.g. rpclit or doclit
* ref: WSI BP 1.1 R 2705
*/
if (options.isExtensionMode()) {
warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(wsdlPort.getName()));
} else {
error(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(wsdlPort.getName()));
}
}
if(soapBinding != null){
}
boolean hasOverloadedOperations = false;
hasOverloadedOperations = true;
break;
}
) {
if (operation
.getName()
break;
error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(operation.getName(), bindingOperation.getName()));
}
}
}
boolean hasOperations = false;
null;
// the WSDL document is invalid
error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(bindingOperation.getName(), binding.getName()));
.iterator()
.next();
} else {
boolean found = false;
.next();
if (expectedInputName == null) {
// the WSDL document is invalid
error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(bindingOperation.getName()));
}
if (expectedOutputName == null) {
// the WSDL document is invalid
error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(bindingOperation.getName()));
}
.getOutput()
.getName())) {
if (found) {
// the WSDL document is invalid
error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(bindingOperation.getName(), bindingOperation.getName()));
}
// got it!
found = true;
}
}
if (!found) {
// the WSDL document is invalid
error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(bindingOperation.getName(), binding.getName()));
}
}
if (!isProvider) {
this.info =
port,
headers);
if(soapBinding != null)
else{
}
hasOperations = true;
}
}
}
if (!isProvider && !hasOperations) {
// emit a warning if there are no operations, except when its a provider port
return false;
}
}
return true;
} catch (NoSuchEntityException e) {
// should not happen
return false;
}
}
/**
* Returns an operation purely from abstract operation
*/
if (options.isExtensionMode()) {
warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName()));
return null;
} else {
error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName(),
}
}
if (isRequestResponse) {
}else{
}
//set the style based on heuristic that message has either all parts defined
// using type(RPC) or element(DOCUMENT)
// Process parameterOrder and get the parameterList
boolean unwrappable = isUnwrappable();
if (!validateParameterName(params)) {
return null;
}
// create a definitive list of parameters to match what we'd like to get
// in the java interface (which is generated much later), parameterOrder
continue;
}
}
}
if (isRequestResponse) {
}
// faults with duplicate names
// handle soap:fault
}
}
/**
* This method is added to fix one of the use case for j2ee se folks, so that we determine
* for non_soap wsdl what could be the style - rpc or document based on parts in the message.
*
* We assume that the message parts could have either all of them with type attribute (RPC)
* or element (DOCUMENT)
*
* Shall this check if parts are mixed and throw error message?
*/
else
}
//check the outputMessage parts
if(outputMessage != null){
else
}
}
}
/* (non-Javadoc)
* @see WSDLModelerBase#processSOAPOperation()
*/
if (options.isExtensionMode()) {
warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName()));
return null;
} else {
error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName(),
}
}
// find out the SOAP operation extension, if any
SOAPOperation.class);
if (soapOperation != null) {
}
}
}
if (info.hasOverloadedOperations) {
}
//attachment
if (soapRequestBody == null) {
// the WSDL document is invalid
error(info.bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(info.bindingOperation.getName()));
}
if (soapRequestBody.isEncoded()) {
if(options.isExtensionMode()){
}else{
}
}
}
// document style
}
//returns false if the operation name is not acceptable
if (!applyOperationNameCustomization())
return null;
warning(soapRequestBody, ModelerMessages.WSDLMODELER_WARNING_R_2716("soapbind:body", info.bindingOperation.getName()));
}
if (isRequestResponse) {
warning(soapResponseBody, ModelerMessages.WSDLMODELER_WARNING_R_2716("soapbind:body", info.bindingOperation.getName()));
}
}else{
}
//ignore operation if there are more than one root part
return null;
// BP 1.1
// R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s),
// only to wsdl:part element(s) that have been defined using the element attribute.
// R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s),
// only to wsdNl:part element(s) that have been defined using the type attribute.
if (options.isExtensionMode())
warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(info.portTypeOperation.getName()));
else
error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_DOCLITOPERATION(info.portTypeOperation.getName()));
else if (isOperationRpcLiteral(styleAndUse)) {
if (options.isExtensionMode())
warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(info.portTypeOperation.getName()));
else
error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_RPCLITOPERATION(info.portTypeOperation.getName()));
}
return null;
}
// Process parameterOrder and get the parameterList
//binding is invalid in the wsdl, ignore the operation.
return null;
boolean unwrappable = isUnwrappable();
} else if (isOperationRpcLiteral(styleAndUse)) {
if (inputMessage != null) {
rpcStruct.setJavaType(new JavaSimpleType("com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload", null));
}
rpcStruct.setJavaType(new JavaSimpleType("com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload", null));
}
}
if (!validateParameterName(params)) {
return null;
}
// create a definitive list of parameters to match what we'd like to get
// in the java interface (which is generated much later), parameterOrder
continue;
}
}
}
if (isRequestResponse) {
}
} else {
//there is no body block
}
if(options.isExtensionMode()){
warning(info.port, ModelerMessages.WSDLMODELER_NON_UNIQUE_BODY_WARNING(info.port.getName(), info.operation.getName(), thatOp.getName(), body));
}else{
error(info.port, ModelerMessages.WSDLMODELER_NON_UNIQUE_BODY_ERROR(info.port.getName(), info.operation.getName(), thatOp.getName(), body));
}
}else{
}
//Add additional headers
if (options.additionalHeaders) {
if (inputMessage != null) {
}
}
}
//it is INOUT
break;
}
}
}
}
}
}
// faults with duplicate names
// handle soap:fault
//set Async property
}
}
if (options.isExtensionMode())
return true;
continue;
error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName()));
return false;
}
return true;
}
//process doclit wrapper style
error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(info.operation.getName(), param.getName(), param.getBlock().getName()));
return false;
}
} else {
//non-wrapper style and rpclit
error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(info.operation.getName(), msg.getName(), param.getName()));
return false;
}
}
}
if (isRequestResponse) {
msg = getOutputMessage();
continue;
error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName()));
return false;
}
return true;
}
//process doclit wrapper style
continue;
error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(info.operation.getName(), param.getName(), param.getBlock().getName()));
return false;
}
} else {
continue;
//non-wrapper style and rpclit
error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(info.operation.getName(), msg.getName(), param.getName()));
return false;
}
}
}
}
return true;
}
private boolean enableMimeContent() {
//first we look at binding operation
JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.bindingOperation, JAXWSBinding.class);
Boolean mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null;
if (mimeContentMapping != null)
return mimeContentMapping;
//then in wsdl:binding
mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null;
if (mimeContentMapping != null)
return mimeContentMapping;
//at last look in wsdl:definitions
jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.document.getDefinitions(), JAXWSBinding.class);
mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null;
if (mimeContentMapping != null)
return mimeContentMapping;
return false;
}
private boolean applyOperationNameCustomization() {
JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
if (operationName != null) {
if (options.isExtensionMode())
warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
else
error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
return false;
}
}
if (options.isExtensionMode())
warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
else
error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
return false;
}
return true;
}
return name;
}
/**
* @param styleAndUse
*/
}
private Operation createAsyncOperation(Operation syncOperation, StyleAndUse styleAndUse, AsyncOperationType asyncType) {
if (!isRequestResponse)
return null;
//create async operations
//creation the async operation name: operationName+Async or customized name
//operation.setName(new QName(operation.getName().getNamespaceURI(), getAsyncOperationName(info.portTypeOperation, operation)));
// Process parameterOrder and get the parameterList
// outParameters = getResponseParameters(response);
// re-create parameterList with unwrapped parameters
if (unwrappable) {
if (inputMessage != null) {
}
}
}
}
} else if (isOperationRpcLiteral(styleAndUse)) {
if (inputMessage != null) {
rpcStruct.setJavaType(new JavaSimpleType("com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload", null));
}
}
// add response blocks, we dont need to create respnse parameters, just blocks will be fine, lets
// copy them from sync optraions
//copy the response blocks from the sync operation
}
}
}
// handle headers
if (numOfOutMsgParts == 1) {
} else if (isOperationRpcLiteral(styleAndUse)) {
Block resBlock = info.operation.getResponse().getBodyBlocksMap().get(new QName(getResponseNamespaceURI(soapResponseBody),
operationName + "Response"));
}
} else {
//create response bean
if (responseBeanType == null) {
error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_RESPONSEBEAN_NOTFOUND(info.operation.getName()));
}
}
QName respBeanName = new QName(soapResponseBody.getNamespace(), getAsyncOperationName(info.operation) + "Response");
Parameter respParam = ModelerUtils.createParameter(info.operation.getName() + "Response", respType, block);
int parameterOrderPosition = 0;
if (inParameter == null) {
if (options.isExtensionMode())
warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name));
else
error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_ERROR_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name));
return null;
}
}
// add callback handlerb Parameter to request
}
return operation;
}
protected boolean isAsync(com.sun.tools.internal.ws.wsdl.document.PortType portType, com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation) {
//First look into wsdl:operation
JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(wsdlOperation, JAXWSBinding.class);
return isAsync;
// then into wsdl:portType
return isAsync;
//then wsdl:definitions
jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
return isAsync;
return false;
}
protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, List<String> definitiveParameterList, boolean processRequest) {
while (headerParts.hasNext()) {
if (processRequest) {
} else {
}
if (processRequest) {
} else {
}
} else {
if (definitiveParameterList != null) {
}
}
}
}
}
}
}
if (portTypeFault != null) {
// the WSDL document is invalid, a wsld:fault in a wsdl:operation of a portType can be bound only once
error(portTypeFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(bindingFault.getName(), info.bindingOperation.getName()));
}
}
}
// The WSDL document is invalid, the wsdl:fault in abstract operation is does not have any binding
if (portTypeFault == null) {
error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(bindingFault.getName(), info.bindingOperation.getName()));
}
}
for ( com.sun.tools.internal.ws.wsdl.document.Fault portTypeFault : info.portTypeOperation.faults()) {
}
}
if(bindingFault == null) {
warning(portTypeFault,ModelerMessages.WSDLMODELER_INVALID_PORT_TYPE_FAULT_NOT_FOUND(portTypeFault.getName(),info.portTypeOperation.getName()));
}
// wsdl:fault message name is used to create the java exception name later on
if (bindingFault != null) {
//get the soapbind:fault from wsdl:fault in the binding
// The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
if (options.isExtensionMode()) {
warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
} else {
error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
}
}
//the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
if (options.isExtensionMode())
warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
else
error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
continue;
}
// the soapFault name must be present
warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(bindingFault.getName(), info.bindingOperation.getName()));
warning(soapFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()));
warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
}
}
if (faultNamespaceURI == null) {
}
com.sun.tools.internal.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
// the WSDL document is invalid
error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(portTypeFault.getName(), faultMessage.getName()));
}
// Don't include fault messages with non-unique soap:fault names
warning(faultPart, ModelerMessages.WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(portTypeFault.getName(), info.portTypeOperation.getName(), faultPart.getName()));
continue;
}
// the WSDL document is invalid
error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(portTypeFault.getName(), faultMessage.getName()));
}
error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
}
//createParentFault(fault);
//createSubfaults(fault);
}
}
if (jaxwsBinding != null) {
}
}
return makePackageQualified(JAXBRIContext.mangleNameToClassName(portTypeFault.getMessage().getLocalPart()));
}
return false;
if (isRequestResponse()) {
return false;
}
return true;
}
//returns false if the wsdl is invalid and operation should be ignored
protected boolean setMessagePartsBinding(SOAPBody body, Message message, StyleAndUse styleAndUse, boolean isInput) {
//get Mime parts
if (isInput) {
} else {
}
//As of now WSDL MIME binding is not supported, so throw the exception when such binding is encounterd
// if(mimeParts.size() > 0){
// fail("wsdlmodeler.unsupportedBinding.mime", new Object[]{});
// }
//if soap:body parts attribute not there, then all unbounded message parts will
// belong to the soap body
//Its a safe assumption that the parts in the message not belonging to header or mime will
// belong to the body?
//throw error that a part cant be bound multiple times, not ignoring operation, if there
//is conflict it will fail latter
if (options.isExtensionMode())
warning(mPart, ModelerMessages.WSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName()));
else
error(mPart, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName()));
}
}
}
//now build the final parts list with header, mime parts and body parts
} else {
}
}
if (options.isExtensionMode())
warning(message, ModelerMessages.WSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName()));
else
error(message, ModelerMessages.WSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName()));
return false;
}
return true;
}
return true;
}
return false;
}
//get MessagePart(s) referenced by parts attribute of soap:body element
while (in.hasMoreTokens()) {
}
}
return partsList;
}
return null;
}
List<MessagePart> getAdditionHeaderParts(BindingOperation bindingOperation,Message message, boolean isInput){
continue;
}
return headerParts;
}
}
}
return headerParts;
}
continue;
com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(), document);
if (headerMessage == null)
continue;
if (headerPart == part)
return headerMessage;
}
return null;
}
if (isInput) {
} else {
}
error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName()));
}
warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName()));
}
com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(),document);
if (headerMessage == null) {
error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName()));
}
error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName()));
}
error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
}
}
return parts;
}
}
}
/**
* @param part
* @return Returns a JAXBType object
*/
}
} else {
}
}
return type;
}
private List<Parameter> getDoclitParameters(Request req, Response res, List<MessagePart> parameterList) {
boolean unwrappable = isUnwrappable();
int pIndex = 0;
if (unwrappable) {
//So build body and header blocks and set to request and response
}
}
}
int index = 0;
}
}
}
} else {
}
}
//S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
//JCodeModel cm = jaxbModel.generateCode(null, errReceiver);
}
}
}
}
} else {
}
}
}
} else {
continue;
}
}
} else {
}
}
}
}
return params;
}
private List<Parameter> getRpcLitParameters(Request req, Response res, Block reqBlock, Block resBlock, List<MessagePart> paramList) {
List<Parameter> inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel, errReceiver);
//create parameters for header and mime parts
int index = 0;
}
}
else
//create Parameters in request or response
//Block mimeBlock = new Block(new QName(part.getName()), type);
}
}
}
}
} else {
}
}
}
setCustomizedParameterName(info.portTypeOperation, inMsg, inMsg.getPart(param.getName()), param, false);
setCustomizedParameterName(info.portTypeOperation, outMsg, outMsg.getPart(param.getName()), param, false);
}
return params;
}
//there is no input message, return zero parameters
boolean unwrappable = isUnwrappable();
boolean doneSOAPBody = false;
//setup request parameters
continue;
if (unwrappable) {
//So build body and header blocks and set to request and response
}
}
} else {
doneSOAPBody = true;
//reqBlock = new Block(new QName(part.getName()), jaxbReqType);
}
if (inParameters == null)
}
}
return inParameters;
}
/**
* @param part
* @param param
* @param wrapperStyle TODO
*/
private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
if (jaxwsBinding == null)
return;
if (wrapperStyle)
String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
}
}
return false;
}
protected boolean isUnwrappable() {
if (!getWrapperStyleCustomization())
return false;
// Wrapper style if the operation's input and output messages each contain
// only a single part
return false;
}
// Wrapper style if the input message part refers to a global element declaration whose localname
// is equal to the operation name
// Wrapper style if the output message part refers to a global element declaration
return false;
//check to see if either input or output message part not bound to soapbing:body
//in that case the operation is not wrapper style
if (((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) ||
((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)))
return false;
// Wrapper style if the elements referred to by the input and output message parts
// (henceforth referred to as wrapper elements) are both complex types defined
// using the xsd:sequence compositor
// Wrapper style if the wrapper elements only contain child elements, they must not
// contain other structures such as xsd:choice, substitution groups1 or attributes
//These checkins are done by jaxb, we just check if jaxb has wrapper children. If there
// are then its wrapper style
//if(inputPart != null && outputPart != null){
boolean inputWrappable = false;
}
//if there are no output part (oneway), the operation can still be wrapper style
if (outputPart == null) {
return inputWrappable;
}
}
return false;
}
private boolean getWrapperStyleCustomization() {
JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeOperation, JAXWSBinding.class);
if (jaxwsBinding != null) {
if (isWrappable != null)
return isWrappable;
}
//then into wsdl:portType
if (jaxwsBinding != null) {
if (isWrappable != null)
return isWrappable;
}
//then wsdl:definitions
if (jaxwsBinding != null) {
if (isWrappable != null)
return isWrappable;
}
return true;
}
/* (non-Javadoc)
* @see WSDLModelerBase#isSingleInOutPart(Set, MessagePart)
*/
SOAPOperation.class);
if (outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor()))
return true;
}
if (inputMessage.getPart(outputPart.getName()).getDescriptor().equals(outputPart.getDescriptor())) {
return true;
}
}
}
return false;
}
private List<Parameter> createRpcLitRequestParameters(Request request, List<String> parameterList, Block block) {
List<Parameter> parameters = ModelerUtils.createRpcLitParameters(message, block, jaxbModel, errReceiver);
//create parameters for header and mime parts
continue;
if (parameters == null)
}
if (parameters == null)
getInputMessage(), paramName);
//create Parameters in request or response
//Block mimeBlock = new Block(new QName(part.getName()), type);
}
if (parameters == null)
}
}
}
setCustomizedParameterName(info.portTypeOperation, message, message.getPart(param.getName()), param, false);
}
return parameters;
}
return "java.awt.Image";
return "javax.xml.transform.Source";
}
return "javax.activation.DataHandler";
}
if (!enableMimeContent()) {
return getJAXBType(part);
}
javaType = "javax.activation.DataHandler";
} else {
}
error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(part.getDescriptor(), part.getName()));
}
//According to AP 1.0,
//RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a
//global element declaration (via the element attribute of the wsdl:part
//element) then the value of the type attribute of a mime:content element
//that binds that part MUST be a content type suitable for carrying an
//XML serialization.
//should we throw warning?
//type = MimeHelper.javaType.DATA_HANDLER_JAVATYPE;
warning(part, ModelerMessages.MIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(part.getName(), mimeType));
}
}
}
}
}
JAXBModelBuilder jaxbModelBuilder = new JAXBModelBuilder(options, classNameCollector, forest, errReceiver);
//set the java package where wsdl artifacts will be generated
//if user provided package name using -p switch (or package property on wsimport ant task)
//ignore the package customization in the wsdl and schema bidnings
//formce the -p option only in the first pass
if (explicitDefaultPackage != null) {
} else {
}
//create pseudo schema for async operations(if any) response bean
}
this.jaxbModelBuilder = jaxbModelBuilder;
}
JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
}
if (jaxwsPackage != null) {
return jaxwsPackage;
}
}
}
if (isProvider) {
return;
}
interfaceName += "_PortType";
}
port,
intf);
}
}
}
protected String getServiceInterfaceName(QName serviceQName, com.sun.tools.internal.ws.wsdl.document.Service wsdlService) {
}
}
//populate the portType map here. We should get rid of all these properties
// lets not do it as it may break NB
//TODO: clean all these stuff part of NB RFE
}
}
if (portTypeName != null) {
// got portType information from WSDL, use it to name the interface
} else {
// somehow we only got the port name, so we use that
}
return interfaceName;
}
: null);
: null;
}
// build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
}
new JavaParameter(
if (javaParameter.isHolder()) {
}
}
}
}
/* (non-Javadoc)
* @see WSDLModelerBase#createJavaMethodForOperation(WSDLPort, WSDLOperation, JavaInterface, Set, Set)
*/
if ((operation instanceof AsyncOperation)) {
return;
}
if (returnParam != null) {
} else {
}
//if its a java keyword after name mangling, then we simply put underscore as there is no
//need to ask user to customize the parameter name if its java keyword
}
new JavaParameter(
name,
if (javaParameter.isHolder()) {
}
}
) {
}
}
}
protected boolean createJavaExceptionFromLiteralType(Fault fault, com.sun.tools.internal.ws.processor.model.Port port, String operationName) {
// use fault namespace attribute
//jaxbMember.setNillable(faultType.isNillable());
javaMember.setInherited(false);
exceptionName += "_Exception";
}
if (existingJavaException != null) {
|| ModelerUtils.isEquivalentLiteralStructures(jaxbStruct, (JAXBStructuredType) existingJavaException.getOwner())) {
// we have mapped this fault already
if (faultType instanceof JAXBStructuredType) {
}
return false;
}
}
}
return true;
}
protected boolean isRequestResponse() {
}
//for async operation ignore the parameterOrder
}
return parameterList;
}
boolean parameterOrderPresent = false;
parameterOrderPresent = true;
} else {
}
//reset the mode and ret flag, as MEssagePArts aer shared across ports
}
if (isRequestResponse()) {
}
}
if (parameterOrderPresent) {
boolean validParameterOrder = true;
// If any part in the parameterOrder is not present in the request or
// response message, we completely ignore the parameterOrder hint
while (paramOrders.hasNext()) {
boolean partFound = false;
partFound = true;
break;
}
}
// if not found, check in output parts
if (!partFound) {
partFound = true;
break;
}
}
}
if (!partFound) {
warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(param, info.operation.getName().getLocalPart()));
validParameterOrder = false;
}
}
//gather input Parts
if (validParameterOrder) {
continue;
}
if (isRequestResponse()) {
}
}
}
}
}
if (isRequestResponse()) {
// at most one output part should be unlisted
//dont add inout as unlisted part
} else {
}
} else {
//param list may contain it, check if its INOUT
//dont add inout as unlisted part
}
}
}
resultPart.setReturn(true);
}
}
//add the input and output unlisted parts
}
}
return params;
}
//parameterOrder attribute is not valid, we ignore it
warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(info.operation.getName().getLocalPart()));
parameterOrderPresent = false;
}
//construct input parameter list with the same order as in input message
}
if (isRequestResponse()) {
continue;
}
}
//append the out parts to the parameterList
}
}
return params;
}
/**
* @param port
* @param suffix
* @return the Java ClassName for a port
*/
}
return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name) || conflictsWithExceptionClass(name);
}
}
}
}
}
return jaxbModelBuilder;
}
//dont process the binding
if (soapBinding == null)
if (soapBinding == null)
return false;
//if soapbind:binding has no style attribute, the default is DOCUMENT
SOAPOperation.class);
if (soapOperation != null) {
SOAPStyle currOpStyle = (soapOperation.getStyle() != null) ? soapOperation.getStyle() : soapBinding.getStyle();
//dont check for the first operation
return false;
}
}
return true;
}
/**
* @param port
*/
if (wrapperStyle != null) {
}
}
protected static void setDocumentationIfPresent(
}
}
}
return name;
}
errReceiver.error(e);
}
}