Document doc = getEmptyDocument(); Element rootElement = doc.createElement("interface"); String serviceName = makeJavaClassName(axisService.getName()); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); if (this.codeGenConfiguration.isBackwordCompatibilityMode()) { addAttribute(doc, "name", makeJavaClassName(axisService.getEndpointName()) + SKELETON_INTERFACE_SUFFIX_BACK, rootElement); } else if (this.codeGenConfiguration.getSkeltonInterfaceName() != null){ addAttribute(doc, "name", this.codeGenConfiguration.getSkeltonInterfaceName() , rootElement); } else { addAttribute(doc, "name", serviceName + SKELETON_INTERFACE_SUFFIX, rootElement); addAttribute(doc, "callbackname", serviceName + CALL_BACK_HANDLER_SUFFIX, rootElement); addAttribute(doc, "isbackcompatible", String.valueOf(codeGenConfiguration.isBackwordCompatibilityMode()), rootElement); fillSyncAttributes(doc, rootElement); loadOperations(doc, rootElement, null); rootElement.appendChild(getUniqueListofFaults(doc));
addAttribute(doc, "package", "", rootElement); addAttribute(doc, "classpackage", codeGenConfiguration.getPackageName(), rootElement); if (this.codeGenConfiguration.getSkeltonClassName() != null) { addAttribute(doc, "name", this.codeGenConfiguration.getSkeltonClassName(), rootElement); } else { if (this.codeGenConfiguration.isBackwordCompatibilityMode()) { addAttribute(doc, "name", className + SKELETON_CLASS_SUFFIX_BACK, rootElement); } else { addAttribute(doc, "name", className + SKELETON_CLASS_SUFFIX, rootElement); addAttribute(doc, "testOmit", "true", rootElement); addAttribute(doc, "servicename", serviceName, rootElement); Element elt = addElement(doc, "messagereceiver", makeJavaClassName(serviceName) + mepToSuffixMap.get(key), rootElement); addAttribute(doc, "mepURI", key.toString(), elt); loadOperations(doc, rootElement, null);
/** * Adds the soap action * * @param doc * @param rootElement * @param qName */ protected void addSOAPAction(Document doc, Element rootElement, QName qName) { addAttribute(doc, "soapaction", (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_ACTION, qName), rootElement); }
/** * Generates the model for the callbacks. */ protected Document createDOMDocumentForException() { Document doc = getEmptyDocument(); Element rootElement = doc.createElement("callback"); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); addAttribute(doc, "name", makeJavaClassName(axisService.getName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); // TODO JAXRPC mapping support should be considered here ?? this.loadOperations(doc, rootElement, null); doc.appendChild(rootElement); return doc; }
private void addConstructorDetails(Document doc, Element faultElement, String exceptionClassName) throws ClassNotFoundException { Class exceptionClass = Class.forName(exceptionClassName); Constructor[] constructors = exceptionClass.getConstructors(); for (int i = 0; i < constructors.length; i++) { Element constructorElement = doc.createElement("constructor"); faultElement.appendChild(constructorElement); Type[] parameters = constructors[i].getGenericParameterTypes(); List existingParamNames = new ArrayList(); for (int j = 0; j < parameters.length; j++){ Element parameterElement = doc.createElement("param"); constructorElement.appendChild(parameterElement); addAttribute(doc, "type", getTypeName(parameters[j]), parameterElement); addAttribute(doc, "name", getParameterName(parameters[j], existingParamNames), parameterElement); } } }
addAttribute(doc, "name", JavaUtils.xmlNameToJava(localPart), methodElement); } else { addAttribute(doc, "name", JavaUtils.xmlNameToJavaIdentifier(localPart), methodElement); addAttribute(doc, "originalName", localPart, methodElement); addAttribute(doc, "namespace", axisOperation.getName().getNamespaceURI(), methodElement); addAttribute(doc, "style", (String) getBindingPropertyFromOperation( WSDLConstants.WSDL_1_1_STYLE, axisOperation.getName()), methodElement); addAttribute(doc, "comment", comment, methodElement); addAttribute(doc, "parameterstyle", (wrapped)?"WRAPPPED":"BARE", methodElement); addAttribute(doc, "dbsupportname", endpointName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX, methodElement); addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(messageExchangePattern) + "", methodElement); addAttribute(doc, "mepURI", messageExchangePattern, methodElement); Parameter wsdl2StyleParameter = axisOperation.getParameter(WSDL2Constants.OPERATION_STYLE); if (wsdl2StyleParameter != null) { addAttribute(doc, "wsdl2Styles", arrayToString((URI[])wsdl2StyleParameter.getValue()), methodElement); addAttribute(doc, "usedbmethod", (String) dbmethname.getValue(), methodElement); addAttribute(doc, "usdbimpl", "true", methodElement); } else { addAttribute(doc, "usdbimpl", "false", methodElement);
String localPart = makeJavaClassName(axisService.getName()); String stubName = makeJavaClassName(axisService.getName() + axisService.getEndpointName()) + STUB_SUFFIX; Document doc = getEmptyDocument(); Element rootElement = doc.createElement("class"); addAttribute(doc, "package", packageName, rootElement); addAttribute(doc, "servicename", localPart, rootElement); addAttribute(doc, "namespace", axisService.getTargetNamespace(), rootElement); if (this.codeGenConfiguration.isBackwordCompatibilityMode()) { addAttribute(doc, "interfaceName", makeJavaClassName(axisService.getEndpointName()) + STUB_INTERFACE_SUFFIX_BACK, rootElement); addAttribute(doc, "name", makeJavaClassName(axisService.getBindingName()) + STUB_SUFFIX, rootElement); } else { if (this.axisService.getEndpoints().size() > 1) { addAttribute(doc, "interfaceName", makeJavaClassName( axisService.getName() + axisService.getEndpointName()), rootElement); addAttribute(doc, "name", stubName, rootElement); } else { addAttribute(doc, "interfaceName", makeJavaClassName(axisService.getName()), rootElement);
Element[] inputParamElement = getInputParamElement(doc, axisOperation); for (int i = 0; i < inputParamElement.length; i++) { addAttribute(doc, "direction", "in", inputParamElement[i]); Element outputParamElement = getOutputParamElement(doc, axisOperation); if (outputParamElement != null) { addAttribute(doc, "direction", "out", outputParamElement); parameters.add(outputParamElement); Element[] faultParamElements = getFaultParamElements(doc, axisOperation); for (int i = 0; i < faultParamElements.length; i++) { addAttribute(doc, "direction", "out", faultParamElements[i]); parameters.add(faultParamElements[i]); addHeaderOperations(headerParameterQNameList, axisBindingOperation, true); List parameterElementList = getParameterElementList(doc, headerParameterQNameList, WSDLConstants.SOAP_HEADER); addHeaderOperations(headerParameterQNameList, axisBindingOperation, false); parameterElementList = getParameterElementList(doc, headerParameterQNameList, WSDLConstants.SOAP_HEADER); addAttribute(doc, "dbtype", codeGenConfiguration.getDatabindingType(), rootElement); addAttribute(doc, "wrapped", wrapflag, rootElement);
Document doc = getEmptyDocument(); Element rootElement = doc.createElement("interface"); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); String localPart = makeJavaClassName(axisService.getName()); addAttribute(doc, "name", localPart + mepToSuffixMap.get(mep), rootElement); addAttribute(doc, "isLowerCaseMethodName", "true", rootElement); addAttribute(doc, "isbackcompatible", String.valueOf(codeGenConfiguration.isBackwordCompatibilityMode()), rootElement); addAttribute(doc, "skeletonname", makeJavaClassName(axisService.getBindingName()) + SKELETON_CLASS_SUFFIX_BACK, rootElement); if (isServerSideInterface) { addAttribute(doc, "skeletonInterfaceName", makeJavaClassName( axisService.getEndpointName()) + SKELETON_INTERFACE_SUFFIX_BACK, rootElement); } else { addAttribute(doc, "skeletonInterfaceName", makeJavaClassName( axisService.getBindingName()) + SKELETON_CLASS_SUFFIX_BACK, rootElement); addAttribute(doc, "skeletonname", this.codeGenConfiguration.getSkeltonClassName(), rootElement);
Element[] param = getInputParamElement(doc, operation); for (int i = 0; i < param.length; i++) { inputElt.appendChild(param[i]); List parameterElementList = getParameterElementList(doc, headerParameterQNameList, WSDLConstants.SOAP_HEADER); parameterElementList.addAll(getParameterElementListForHttpHeader(doc, (ArrayList) getBindingPropertyFromMessage( WSDL2Constants.ATTR_WHTTP_HEADER, operation.getName(), WSDLConstants.WSDL_MESSAGE_DIRECTION_IN), WSDLConstants.HTTP_HEADER)); parameterElementList.addAll(getParameterElementListForSOAPModules(doc, (ArrayList) getBindingPropertyFromMessage( WSDL2Constants.ATTR_WSOAP_MODULE, operation.getName(), Policy policy = getBindingPolicyFromMessage(bindingOperation, WSDLConstants.MESSAGE_LABEL_IN_VALUE); addAttribute(doc, "policy", PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)), inputElt);
Document doc = getEmptyDocument(); Element rootElement = doc.createElement("interface"); String localPart = null; if (this.codeGenConfiguration.isBackwordCompatibilityMode()) { localPart = makeJavaClassName(axisService.getEndpointName() + STUB_INTERFACE_SUFFIX_BACK); } else { if (this.axisService.getEndpoints().size() > 1) { localPart = makeJavaClassName(axisService.getName() + axisService.getEndpointName()); } else { localPart = makeJavaClassName(axisService.getName()); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); addAttribute(doc, "name", localPart, rootElement); addAttribute(doc, "callbackname", makeJavaClassName(axisService.getName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); addAttribute(doc, "isbackcompatible", String.valueOf(codeGenConfiguration.isBackwordCompatibilityMode()), rootElement); fillSyncAttributes(doc, rootElement); loadOperations(doc, rootElement, null); addAttribute(doc, "skip-write", "yes", rootElement); processModelObjects(mapper.getAllMappedObjects(), rootElement, doc);
String coreClassName = makeJavaClassName(axisService.getName()); Document doc = getEmptyDocument(); Element rootElement = doc.createElement("class"); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); if (this.axisService.getEndpoints().size() > 1) { addAttribute(doc, "name", makeJavaClassName(axisService.getName() + axisService.getEndpointName()) + TEST_SUFFIX, rootElement); } else { addAttribute(doc, "name", makeJavaClassName(axisService.getName()) + TEST_SUFFIX, rootElement); addAttribute(doc, "namespace", axisService.getTargetNamespace(), rootElement); addAttribute(doc, "interfaceName", coreClassName, rootElement); if (codeGenConfiguration.isPackClasses()) { if (this.axisService.getEndpoints().size() > 1) { addAttribute(doc, "callbackname", makeJavaClassName( axisService.getName() + axisService.getEndpointName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); } else { addAttribute(doc, "callbackname", makeJavaClassName(axisService.getName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); addAttribute(doc, "callbackname", coreClassName + CALL_BACK_HANDLER_SUFFIX, rootElement); addAttribute(doc, "stubname", makeJavaClassName(axisService.getBindingName()) + STUB_SUFFIX,
Element param = getOutputParamElement(doc, operation); List outputElementList = getParameterElementList(doc, headerParameterQNameList, WSDLConstants.SOAP_HEADER); outputElementList.addAll(getParameterElementListForHttpHeader(doc, (ArrayList) getBindingPropertyFromMessage( WSDL2Constants.ATTR_WHTTP_HEADER, operation.getName(), Policy policy = getBindingPolicyFromMessage(bindingOperation, WSDLConstants.MESSAGE_LABEL_OUT_VALUE); addAttribute(doc, "policy", PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)), outputElt);
Iterator iterator = fullyQualifiedFaultClassNameMap.keySet().iterator(); while (iterator.hasNext()) { Document doc = getEmptyDocument(); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), faultElement); addAttribute(doc, "name", (String) faultClassNameMap.get(key), faultElement); addAttribute(doc, "shortName", (String) faultClassNameMap.get(key), faultElement); addAttribute(doc, "serialVersionUID", String.valueOf(System.currentTimeMillis()), faultElement); addAttribute(doc, "exceptionBaseClass", this.codeGenConfiguration.getExceptionBaseClassName(), faultElement); try { addConstructorDetails(doc, faultElement, this.codeGenConfiguration.getExceptionBaseClassName()); } catch (ClassNotFoundException e) { log.warn("Can not load the Exception base class"); addAttribute(doc, "exceptionBaseClass", Exception.class.getName(), faultElement); addAttribute(doc, "type", (typeMapping == null) ? "" : typeMapping, faultElement); String attribValue = (String) instantiatableMessageClassNames.
addAttribute(doc, "comment", faultComment, paramElement); addAttribute(doc, "name", (String) fullyQualifiedFaultClassNameMap.get(msg.getName()), paramElement); addAttribute(doc, "shortName", (String) faultClassNameMap.get(msg.getName()), paramElement); addAttribute(doc, "namespace", msg.getElementQName().getNamespaceURI(), paramElement); addAttribute(doc, "localname", msg.getElementQName().getLocalPart(), paramElement); addAttribute(doc, "nsuri", msg.getElementQName().getNamespaceURI(), qNameElement); addAttribute(doc, "localname", msg.getElementQName().getLocalPart(), qNameElement); paramElement.appendChild(qNameElement); addAttribute(doc, "type", (typeMapping == null) ? "" : typeMapping, paramElement); addShortType(paramElement, (msg.getElementQName() == null) ? null : msg.getElementQName().getLocalPart()); addAttribute(doc, "instantiatableType", attribValue == null ? "" : attribValue, paramElement);
Document doc = getEmptyDocument(); Element rootElement = doc.createElement("ant"); String serviceName = makeJavaClassName(axisService.getName()); String packageName = codeGenConfiguration.getPackageName(); String[] dotSeparatedValues = packageName.split("\\."); addAttribute(doc, "package", dotSeparatedValues[0], rootElement); addAttribute(doc, "name", serviceName, rootElement); addAttribute(doc, "servicename", serviceName, rootElement); addAttribute(doc, "src", codeGenConfiguration.getSourceLocation(), rootElement); addAttribute(doc, "resource", codeGenConfiguration.getResourceLocation(), rootElement); addAttribute(doc, "artifactname", "Services", rootElement); } else { addAttribute(doc, "artifactname", this.axisService.getName() , rootElement); addAttribute(doc, "testOmit", "true", rootElement); addAttribute(doc, "isserverside", "yes",
addFaultMessages(axisOperation.getFaultMessages(), faultListForMep); } else { if (mep.equals(axisOperation.getMessageExchangePattern())) { addFaultMessages(axisOperation.getFaultMessages(), faultListForMep); addAttribute(doc, "name", (String) fullyQualifiedFaultClassNameMap.get(key), faultElement); addAttribute(doc, "shortName", (String) faultClassNameMap.get(key), faultElement); addAttribute(doc, "type", (typeMapping == null) ? "" : typeMapping, faultElement); addAttribute(doc, "instantiatableType", attribValue == null ? "" : attribValue, faultElement); addAttribute(doc, "localname", exceptionName == null ? "" : exceptionName, faultElement); addAttribute(doc, "default", "yes", faultElement); addAttribute(doc, "value", getParamInitializer(typeMapping), faultElement);
addAttribute(doc, "name", parameterName, paramElement); addAttribute(doc, "comment", (comment == null) ? "" : comment, paramElement); addAttribute(doc, "type", typeMappingStr, paramElement); addShortType(paramElement, (outputMessage.getElementQName() == null) ? null : outputMessage.getElementQName().getLocalPart()); addAttribute(doc, "default", "yes", paramElement); addAttribute(doc, "location", "body", paramElement); String localPart = operation.getName().getLocalPart(); addAttribute(doc, "opname", JavaUtils.xmlNameToJava(localPart), paramElement); if (outputMessage.getParameter(Constants.COMPLEX_TYPE) != null) { Parameter parameter = outputMessage.getParameter(Constants.COMPLEX_TYPE); addAttribute(doc, "complextype", (String) parameter.getValue(), paramElement); addAttribute(doc, "partname", javaName, paramElement); qName = (QName) iter.next(); paramElement. appendChild(generateParamComponent(doc, null, this.mapper.getParameterName(qName), if (paramQName != null) { Element qNameElement = doc.createElement("qname"); addAttribute(doc, "nsuri", paramQName.getNamespaceURI(), qNameElement);
/** * A convenient method for the generating optionParam components * * @param doc * @param name * @param value * @return Element */ protected Element generateOptionParamComponent(Document doc, String name, String value) { Element optionParamElement = doc.createElement("optionParam"); addAttribute(doc, "name", name, optionParamElement); addAttribute(doc, "value", value, optionParamElement); return optionParamElement; }
addAttribute(doc, "name", (String) fullyQualifiedFaultClassNameMap.get(key), faultElement); addAttribute(doc, "shortName", (String) faultClassNameMap.get(key), faultElement); addAttribute(doc, "type", (typeMapping == null) ? "" : typeMapping, faultElement); get(key); addAttribute(doc, "instantiatableType", attribValue == null ? "" : attribValue, faultElement); addAttribute(doc, "default", "yes", faultElement); addAttribute(doc, "value", getParamInitializer(typeMapping), faultElement);