public JaxwsWsdlFile(Enunciate enunciate, String artifactId, WsdlInfo wsdlInfo, EnunciateJaxbContext context, String baseUri, Map<String, String> namespacePrefixes, FacetFilter facetFilter) { super(enunciate, artifactId, wsdlInfo.getFilename(), namespacePrefixes, facetFilter); this.wsdlInfo = wsdlInfo; this.baseUri = baseUri; this.context = context; }
/** * The list of imported schemas. * * @return The list of imported schemas. */ public List<SchemaInfo> getImportedSchemas() { Set<String> importedNamespaces = getImportedNamespaces(); importedNamespaces.remove(getTargetNamespace()); //the "associated" schema is either inlined or included, but not imported. List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(); for (String ns : importedNamespaces) { SchemaInfo schema = lookupSchema(ns); if (schema != null) { schemas.add(schema); } } return schemas; }
@Override public InterfaceDescriptionFile getWsdlFile() { return this.wsdlInfo.getWsdlFile(); }
/** * Get the schema associated with this WSDL. * * @return The schema associated with this WSDL. */ public SchemaInfo getAssociatedSchema() { return lookupSchema(getTargetNamespace()); }
for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { if (facetFilter.accept(ei)) { for (WebMethod webMethod : ei.getWebMethods()) { model.put("baseUri", this.enunciate.getConfiguration().getApplicationRoot()); for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { if (wsdlInfo.getWsdlFile() == null) { throw new EnunciateException("WSDL " + wsdlInfo.getId() + " doesn't have a filename."); for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { if (facetFilter.accept(ei)) { model.put("endpointInterface", ei); model.put("wsdlFileName", wsdlInfo.getFilename());
/** * Get the imported namespaces used by this WSDL. * * @return The imported namespaces used by this WSDL. */ public Set<String> getImportedNamespaces() { Set<EndpointInterface> endpointInterfaces = getEndpointInterfaces(); if ((endpointInterfaces == null) || (endpointInterfaces.size() == 0)) { throw new IllegalStateException("WSDL for " + getTargetNamespace() + " has no endpoint interfaces!"); } HashSet<String> importedNamespaces = new HashSet<String>(); //always import the list of known namespaces. importedNamespaces.add("http://schemas.xmlsoap.org/wsdl/"); importedNamespaces.add("http://schemas.xmlsoap.org/wsdl/http/"); importedNamespaces.add("http://schemas.xmlsoap.org/wsdl/mime/"); importedNamespaces.add("http://schemas.xmlsoap.org/wsdl/soap/"); importedNamespaces.add("http://schemas.xmlsoap.org/wsdl/soap12/"); importedNamespaces.add("http://schemas.xmlsoap.org/soap/encoding/"); importedNamespaces.add("http://www.w3.org/2001/XMLSchema"); for (EndpointInterface endpointInterface : endpointInterfaces) { importedNamespaces.addAll(endpointInterface.getReferencedNamespaces()); } if (isInlineSchema()) { SchemaInfo associatedSchema = getAssociatedSchema(); if (associatedSchema != null) { importedNamespaces.addAll(associatedSchema.getReferencedNamespaces()); } } return importedNamespaces; }
String defaultFilename = ns2prefix.get(wsdlInfo.getTargetNamespace()) + ".wsdl"; WsdlConfig explicitConfig = wsdlConfigs.get(wsdlInfo.getTargetNamespace()); wsdlInfo.setFilename(explicitConfig.getUseFile().getName()); wsdlInfo.setWsdlFile(new StaticInterfaceDescriptionFile(explicitConfig.getUseFile(), this.enunciate)); wsdlInfo.setFilename(explicitConfig.getFilename() != null ? explicitConfig.getFilename() : defaultFilename); wsdlInfo.setInlineSchema(explicitConfig.isInlineSchema()); wsdlInfo.setWsdlFile(new JaxwsWsdlFile(this.enunciate, defaultFilename, wsdlInfo, this.jaxbModule.getJaxbContext(), baseUri, ns2prefix, facetFilter)); wsdlInfo.setFilename(defaultFilename); wsdlInfo.setWsdlFile(new JaxwsWsdlFile(this.enunciate, defaultFilename, wsdlInfo, this.jaxbModule.getJaxbContext(), baseUri, ns2prefix, facetFilter));
wsdlInfo = new WsdlInfo(jaxbContext); wsdlInfo.setId(prefix); wsdls.put(namespace, wsdlInfo); wsdlInfo.setTargetNamespace(namespace); wsdlInfo.getEndpointInterfaces().add(ei); this.endpointInterfaces.add(ei); debug("Added %s as a JAX-WS endpoint interface.", ei.getQualifiedName());
public List<WebMessage> getWebMessages() { ArrayList<WebMessage> messages = new ArrayList<WebMessage>(); HashSet<String> foundFaults = new HashSet<String>(); for (EndpointInterface ei : getEndpointInterfaces()) { Collection<WebMethod> webMethods = ei.getWebMethods(); for (WebMethod method : webMethods) { for (WebMessage webMessage : method.getMessages()) { if (webMessage.isFault() && !foundFaults.add(((WebFault) webMessage).getQualifiedName().toString())) { continue; } messages.add(webMessage); } } } return messages; }
@Override public List<? extends Service> getServices() { ArrayList<Service> services = new ArrayList<Service>(); FacetFilter facetFilter = this.wsdlInfo.getContext().getContext().getConfiguration().getFacetFilter(); for (EndpointInterface endpointInterface : this.wsdlInfo.getEndpointInterfaces()) { if (!facetFilter.accept(endpointInterface)) { continue; } services.add(new ServiceImpl(endpointInterface, "", registrationContext)); } Collections.sort(services, new Comparator<Service>() { @Override public int compare(Service o1, Service o2) { return o1.getLabel().compareTo(o2.getLabel()); } }); return services; } }
@Override public String getNamespace() { return this.wsdlInfo.getTargetNamespace(); }
for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { if (facetFilter.accept(ei)) { for (WebMethod webMethod : ei.getWebMethods()) { model.put("baseUri", this.enunciate.getConfiguration().getApplicationRoot()); for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { if (wsdlInfo.getWsdlFile() == null) { throw new EnunciateException("WSDL " + wsdlInfo.getId() + " doesn't have a filename."); for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { if (facetFilter.accept(ei)) { model.put("endpointInterface", ei); model.put("wsdlFileName", wsdlInfo.getFilename());
String defaultFilename = ns2prefix.get(wsdlInfo.getTargetNamespace()) + ".wsdl"; WsdlConfig explicitConfig = wsdlConfigs.get(wsdlInfo.getTargetNamespace()); wsdlInfo.setFilename(explicitConfig.getUseFile().getName()); wsdlInfo.setWsdlFile(new StaticInterfaceDescriptionFile(explicitConfig.getUseFile(), this.enunciate)); wsdlInfo.setFilename(explicitConfig.getFilename() != null ? explicitConfig.getFilename() : defaultFilename); wsdlInfo.setInlineSchema(explicitConfig.isInlineSchema()); wsdlInfo.setWsdlFile(new JaxwsWsdlFile(this.enunciate, defaultFilename, wsdlInfo, this.jaxbModule.getJaxbContext(), baseUri, ns2prefix, facetFilter)); wsdlInfo.setFilename(defaultFilename); wsdlInfo.setWsdlFile(new JaxwsWsdlFile(this.enunciate, defaultFilename, wsdlInfo, this.jaxbModule.getJaxbContext(), baseUri, ns2prefix, facetFilter));
HashMap<String, WebFault> allFaults = new HashMap<String, WebFault>(); for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { String pckg = ei.getPackage().getQualifiedName().toString(); if (!packageToNamespaceConversions.containsKey(pckg)) {
@Override protected Map<String, Object> createModel() { Map<String, Object> model = super.createModel(); model.put("wsdl", this.wsdlInfo); String baseUri = this.baseUri; if (baseUri == null) { baseUri = "http://localhost:8080/"; //if the base uri isn't configured, we have to make something up. } model.put("baseUri", baseUri); SchemaInfo schema = context.getSchemas().get(wsdlInfo.getTargetNamespace()); if (schema != null) { model.put("isDefinedGlobally", new IsDefinedGloballyMethod(schema)); } model.put("accessorOverridesAnother", new AccessorOverridesAnotherMethod()); model.put("qnameForType", new QNameForTypeMethod(context)); return model; }
HashMap<String, WebFault> allFaults = new HashMap<String, WebFault>(); for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) { String pckg = ei.getPackage().getQualifiedName().toString(); if (!packageToNamespaceConversions.containsKey(pckg)) {
protected File copyResources() { File resourcesDir = getResourcesDir(); resourcesDir.mkdirs(); try { if (this.jaxwsModule != null) { for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { if (wsdlInfo.getWsdlFile() != null) { wsdlInfo.getWsdlFile().writeTo(resourcesDir); } } } for (SchemaInfo schemaInfo : this.jaxbModule.getJaxbContext().getSchemas().values()) { if (schemaInfo.getSchemaFile() != null) { schemaInfo.getSchemaFile().writeTo(resourcesDir); } } } catch (IOException e) { throw new EnunciateException(e); } return resourcesDir; }
@Override protected Map<String, Object> createModel() { Map<String, Object> model = super.createModel(); model.put("wsdl", this.wsdlInfo); String baseUri = this.baseUri; if (baseUri == null) { baseUri = "http://localhost:8080/"; //if the base uri isn't configured, we have to make something up. } model.put("baseUri", baseUri); SchemaInfo schema = context.getSchemas().get(wsdlInfo.getTargetNamespace()); if (schema != null) { model.put("isDefinedGlobally", new IsDefinedGloballyMethod(schema)); } model.put("accessorOverridesAnother", new AccessorOverridesAnotherMethod()); model.put("qnameForType", new QNameForTypeMethod(context)); return model; }
public JaxwsWsdlFile(Enunciate enunciate, String artifactId, WsdlInfo wsdlInfo, EnunciateJaxbContext context, String baseUri, Map<String, String> namespacePrefixes, FacetFilter facetFilter) { super(enunciate, artifactId, wsdlInfo.getFilename(), namespacePrefixes, facetFilter); this.wsdlInfo = wsdlInfo; this.baseUri = baseUri; this.context = context; }
protected File copyResources() { File resourcesDir = getResourcesDir(); resourcesDir.mkdirs(); try { if (this.jaxwsModule != null) { for (WsdlInfo wsdlInfo : this.jaxwsModule.getJaxwsContext().getWsdls().values()) { if (wsdlInfo.getWsdlFile() != null) { wsdlInfo.getWsdlFile().writeTo(resourcesDir); } } } for (SchemaInfo schemaInfo : this.jaxbModule.getJaxbContext().getSchemas().values()) { if (schemaInfo.getSchemaFile() != null) { schemaInfo.getSchemaFile().writeTo(resourcesDir); } } } catch (IOException e) { throw new EnunciateException(e); } return resourcesDir; }