/** * 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; }
/** * Looks for the SOAPVersion and adds it. * * @param doc * @param rootElement */ protected void addSoapVersion(Document doc, Element rootElement) { // loop through the extensibility elements to get to the bindings element addAttribute(doc, "soap-version", (String) axisBinding.getProperty(WSDL2Constants.ATTR_WSOAP_VERSION), rootElement); }
/** * @param doc * @param rootElement */ protected void fillSyncAttributes(Document doc, Element rootElement) { addAttribute(doc, "isAsync", this.codeGenConfiguration.isAsyncOn() ? "1" : "0", rootElement); addAttribute(doc, "isSync", this.codeGenConfiguration.isSyncOn() ? "1" : "0", rootElement); }
protected List getParameterElementListForSOAPModules(Document doc, List parameters) { List parameterElementList = new ArrayList(); if ((parameters != null) && !parameters.isEmpty()) { int count = parameters.size(); for (int i = 0; i < count; i++) { Element param = doc.createElement("param"); SOAPModuleMessage soapModuleMessage = (SOAPModuleMessage) parameters.get(i); // header name is to set the header value addAttribute(doc, "uri", soapModuleMessage.getUri(), param); addAttribute(doc, "location", "wsoap_module", param); parameterElementList.add(param); } } return parameterElementList; }
/** * 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); }
/** * Gets the base64 types. If not available this will be empty!!! * * @param doc * @return Returns Element. */ protected Element getBase64Elements(Document doc) { Element root = doc.createElement("base64Elements"); Element elt; QName qname; // this is a list of QNames List list = (List) codeGenConfiguration.getProperties().get(Constants.BASE_64_PROPERTY_KEY); if ((list != null) && !list.isEmpty()) { int count = list.size(); for (int i = 0; i < count; i++) { qname = (QName) list.get(i); elt = doc.createElement("name"); addAttribute(doc, "ns-url", qname.getNamespaceURI(), elt); addAttribute(doc, "localName", qname.getLocalPart(), elt); root.appendChild(elt); } } return root; }
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); } } }
protected List getParameterElementListForHttpHeader(Document doc, List parameters, String location) { List parameterElementList = new ArrayList(); if ((parameters != null) && !parameters.isEmpty()) { int count = parameters.size(); for (int i = 0; i < count; i++) { Element param = doc.createElement("param"); HTTPHeaderMessage httpHeaderMessage = (HTTPHeaderMessage) parameters.get(i); QName qName = httpHeaderMessage.getqName(); String name = httpHeaderMessage.getName(); // use name as the name attribute of the parameter addAttribute(doc, "name", JavaUtils.xmlNameToJavaIdentifier(name), param); // header name is to set the header value addAttribute(doc, "headername", name, param); String typeMapping = this.mapper.getTypeMappingName(qName); String typeMappingStr = (typeMapping == null) ? "" : typeMapping; addAttribute(doc, "type", typeMappingStr, param); addAttribute(doc, "location", location, param); parameterElementList.add(param); } } return parameterElementList; }
QName name = header.getElement(); addAttribute(doc, "name", this.mapper.getParameterName(name), param); : typeMapping; addAttribute(doc, "type", typeMappingStr, param); addAttribute(doc, "location", location, param); if (header.isMustUnderstand()) { addAttribute(doc, "mustUnderstand", "true", param); addAttribute(doc, "nsuri", name.getNamespaceURI(), qNameElement); addAttribute(doc, "localname", name.getLocalPart(), qNameElement); param.appendChild(qNameElement);
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);
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",
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); makeJavaClassName(serviceName) + mepToSuffixMap.get(key), rootElement); addAttribute(doc, "mepURI", key.toString(), elt);
/** * 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; }
/** * Gets an element representing the operation names * * @param doc * @return Returns Element. */ protected Element getOpNames(Document doc) { Element root = doc.createElement("opnames"); Element elt; for (Iterator operationsIterator = axisService.getOperations(); operationsIterator.hasNext();) { AxisOperation axisOperation = (AxisOperation) operationsIterator.next(); elt = doc.createElement("name"); String localPart = axisOperation.getName().getLocalPart(); elt.appendChild(doc.createTextNode(JavaUtils.xmlNameToJava(localPart))); //what needs to be put here as the opertation namespace is actually the //traget namespace of the service addAttribute(doc, "opnsuri", axisService.getTargetNamespace(), elt); root.appendChild(elt); } return root; }
/** * set the short type as it is in the data binding * * @param paramElement * @param xmlName */ protected void addShortType(Element paramElement, String xmlName) { if (xmlName != null) { String javaName; if (JavaUtils.isJavaKeyword(xmlName)) { javaName = JavaUtils.makeNonJavaKeyword(xmlName); } else { javaName = JavaUtils.capitalizeFirstChar(JavaUtils .xmlNameToJava(xmlName)); } addAttribute(paramElement.getOwnerDocument(), "shorttype", javaName, paramElement); } else { addAttribute(paramElement.getOwnerDocument(), "shorttype", "", paramElement); } }
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);
/** * Generates the model for the callbacks. */ protected Document createDOMDocumentForCallbackHandler() { Document doc = getEmptyDocument(); Element rootElement = doc.createElement("callback"); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); if (codeGenConfiguration.isPackClasses() && this.axisService.getEndpoints().size() > 1) { addAttribute(doc, "name", makeJavaClassName(axisService.getName() + axisService.getEndpointName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); } else { 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; }
addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); if (this.codeGenConfiguration.isBackwordCompatibilityMode()) { addAttribute(doc, "name", makeJavaClassName(axisService.getBindingName()) + SKELETON_CLASS_SUFFIX_BACK, rootElement); } else if (this.codeGenConfiguration.getSkeltonClassName() != null){ addAttribute(doc, "name", this.codeGenConfiguration.getSkeltonClassName(), rootElement); } else { addAttribute(doc, "name", serviceName + SKELETON_CLASS_SUFFIX, rootElement); addAttribute(doc, "callbackname", serviceName + CALL_BACK_HANDLER_SUFFIX, rootElement); addAttribute(doc, "isbackcompatible", String.valueOf(codeGenConfiguration.isBackwordCompatibilityMode()), rootElement); if (isSkeletonInterface) { if (this.codeGenConfiguration.isBackwordCompatibilityMode()) { addAttribute(doc, "skeletonInterfaceName", makeJavaClassName( axisService.getEndpointName()) + SKELETON_INTERFACE_SUFFIX_BACK, rootElement); } else if (this.codeGenConfiguration.getSkeltonInterfaceName() != null){ addAttribute(doc, "skeletonInterfaceName", this.codeGenConfiguration.getSkeltonInterfaceName(), rootElement); } else { addAttribute(doc, "skeletonInterfaceName", serviceName + SKELETON_INTERFACE_SUFFIX, rootElement);
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); addAttribute(doc, "skip-write", "yes", rootElement);
addAttribute(doc, "policy", PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)), outputElt);