protected void addReferencedDataTypeDefinitions(EndpointInterface ei) { LinkedList<Element> contextStack = new LinkedList<>(); contextStack.push(ei); try { for (WebMethod webMethod : ei.getWebMethods()) { addReferencedTypeDefinitions(webMethod, contextStack); } } finally { contextStack.pop(); } }
/** * This doesn't have anything to do with the spec, but can be used in case a bean is needed to be * generated for an RPC input message. The bean name will be generated in accordance with the instructions * given in the specification that apply to document/literal wrapped request beans. * * @return A possible request bean name. */ public String getRequestBeanName() { String capitalizedName = this.webMethod.getSimpleName().toString(); capitalizedName = Character.toString(capitalizedName.charAt(0)).toUpperCase() + capitalizedName.substring(1); return this.webMethod.getDeclaringEndpointInterface().getPackage().getQualifiedName() + ".jaxws." + capitalizedName; }
/** * The set of namespace URIs that this web service references. * * @return The set of namespace URIs that this web service references. */ public Set<String> getReferencedNamespaces() { HashSet<String> namespaces = new HashSet<String>(); namespaces.add(getTargetNamespace()); Collection<WebMethod> webMethods = getWebMethods(); for (WebMethod webMethod : webMethods) { namespaces.addAll(webMethod.getReferencedNamespaces()); } return namespaces; }
/** * The name of the soap binding. This is just used in the WSDL, so it's not really necessary-- it's more for aesthetic purposes. * * @return The name of the soap binding. * @see com.webcohesion.enunciate.metadata.soap.SoapBindingName */ public String getSoapBindingName() { String name = getSimpleName() + "PortBinding"; SoapBindingName bindingNameInfo = getAnnotation(SoapBindingName.class); if (bindingNameInfo != null) { name = bindingNameInfo.value(); } return name; }
@Override public String getSlug() { return "service_" + this.ei.getContext().getJaxbContext().getNamespacePrefixes().get(this.ei.getTargetNamespace()) + "_" + this.ei.getServiceName(); }
annotation = getAnnotation(javax.jws.WebService.class); impls = new ArrayList<EndpointImplementation>(); if (annotation != null) { if (isClass()) { impls.add(new EndpointImplementation(getDelegate(), this, context)); if (isEndpointImplementation(declaration)) { WebService ws = declaration.getAnnotation(WebService.class); if (getQualifiedName().toString().equals(ws.endpointInterface())) { impls.add(new EndpointImplementation(declaration, this, context)); for (ExecutableElement method : getMethods()) { if (isWebMethod(method)) { webMethods.add(new WebMethod(method, this, context)); while ((declaration != null) && (!Object.class.getName().equals(((TypeElement)declaration).getQualifiedName().toString()))) { for (ExecutableElement method : ElementFilter.methodsIn(declaration.getEnclosedElements())) { if (isWebMethod(method)) {
for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { String pckg = ei.getPackage().getQualifiedName().toString(); if (!packageToNamespaceConversions.containsKey(pckg)) { packageToNamespaceConversions.put(pckg, packageToNamespace(pckg)); for (WebMethod webMethod : ei.getWebMethods()) { for (WebFault webFault : webMethod.getWebFaults()) { allFaults.put(webFault.getQualifiedName().toString(), webFault);
String namespace = ei.getTargetNamespace(); for (WebMethod webMethod : ei.getWebMethods()) { for (WebMessage webMessage : webMethod.getMessages()) { for (WebMessagePart messagePart : webMessage.getParts()) { debug("Added %s as a JAX-WS endpoint interface.", ei.getQualifiedName()); debug("Unable to find source file for %s.", ei.getQualifiedName());
@Override public String getNamespace() { return this.ei.getTargetNamespace(); }
for (EndpointInterface ei : this.jaxwsModule.getJaxwsContext().getEndpointInterfaces()) { Map<String, javax.lang.model.element.Element> paramsByName = new HashMap<String, javax.lang.model.element.Element>(); for (WebMethod webMethod : ei.getWebMethods()) { for (WebParam webParam : webMethod.getWebParameters()) { if (ElementUtils.capitalize(webMethod.getClientSimpleName()).equals(ei.getClientSimpleName())) { warn("%s: C# can't handle methods that are of the same name as their containing class. Either rename the method, or use the @org.codehaus.enunciate.ClientName annotation to rename the method (or type) on the client-side.", positionOf(webMethod)); usesUnmappableElements = true;
@Override public String getLabel() { Label label = this.ei.getAnnotation(Label.class); if (label != null) { return label.value(); } JavaDoc.JavaDocTagList tags = this.ei.getJavaDoc().get("label"); if (tags != null && tags.size() > 0) { String tag = tags.get(0).trim(); if (!tag.isEmpty()) { return tag; } } String serviceName = this.ei.getServiceName(); if (serviceName.equals(this.ei.getSimpleName() + "Service")) { serviceName = this.ei.getSimpleName().toString(); } return serviceName; }
@Override public List<? extends Operation> getOperations() { ArrayList<Operation> operations = new ArrayList<Operation>(); FacetFilter facetFilter = this.ei.getContext().getContext().getConfiguration().getFacetFilter(); for (WebMethod webMethod : this.ei.getWebMethods()) { if (facetFilter.accept(webMethod)) { operations.add(new OperationImpl(webMethod, this, registrationContext)); } } return operations; }
@Override public List<String> getSeeAlso() { JavaDoc.JavaDocTagList tags = this.ei.getJavaDoc(this.registrationContext.getTagHandler()).get("see"); if (tags == null) { tags = ((DecoratedElement) this.ei.getPackage()).getJavaDoc(this.registrationContext.getTagHandler()).get("see"); } return tags; }
@Override public ServiceGroup getGroup() { return new ServiceGroupImpl(this.ei.getContext().getWsdls().get(this.ei.getTargetNamespace()), this.registrationContext); }
/** * Calculates a namespace URI for a given package. Default implementation uses the algorithm defined in * section 3.2 of the jax-ws spec. * * @return The calculated namespace uri. */ protected String calculateNamespaceURI() { PackageElement pkg = getPackage(); if ((pkg == null) || ("".equals(pkg.getQualifiedName().toString()))) { throw new EnunciateException(getQualifiedName() + ": a web service in no package must specify a target namespace."); } String[] tokens = pkg.getQualifiedName().toString().split("\\."); String uri = "http://"; for (int i = tokens.length - 1; i >= 0; i--) { uri += tokens[i]; if (i != 0) { uri += "."; } } uri += "/"; return uri; }
EndpointInterface ei = new EndpointInterface(element, elements, aggressiveWebMethodExcludePolicy, jaxwsContext); for (EndpointImplementation implementation : ei.getEndpointImplementations()) { String urlPattern = eiPaths.get(implementation.getQualifiedName().toString()); if (urlPattern != null) { urlPattern = urlPattern.substring(0, urlPattern.length() - 2) + ei.getServiceName();
@Override public <A extends Annotation> A getAnnotation(Class<A> annotationType) { return this.ei.getAnnotation(annotationType); }
@Override public Map<String, AnnotationMirror> getAnnotations() { return this.ei.getAnnotations(); }
/** * Gets the target namespace of this web service. * * @return the target namespace of this web service. */ public String getTargetNamespace() { String targetNamespace = null; if (annotation != null) { targetNamespace = annotation.targetNamespace(); } if ((targetNamespace == null) || ("".equals(targetNamespace))) { targetNamespace = calculateNamespaceURI(); } return targetNamespace; }
@Override public Set<String> getStyles() { return Styles.gatherStyles(this.ei, this.ei.getContext().getContext().getConfiguration().getAnnotationStyles()); }