本文整理了Java中javax.wsdl.Import.setDefinition()
方法的一些代码示例,展示了Import.setDefinition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Import.setDefinition()
方法的具体详情如下:
包路径:javax.wsdl.Import
类名称:Import
方法名:setDefinition
[英]This property can be used to hang a referenced Definition, and the top-level Definition (i.e. the one with the <import>) will use this Definition when resolving referenced WSDL parts. This would need to be made into a generic reference to handle other types of referenced documents.
[中]此属性可用于挂起引用的定义,顶级定义(即带有<import>的定义)在解析引用的WSDL部分时将使用此定义。需要将其转换为通用引用,以处理其他类型的引用文档。
代码示例来源:origin: wsdl4j/wsdl4j
importDef.setDefinition(importedDef);
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
/**
* Create an import element for a WSDL import of a WSDL document.
*
* @param wsdlDocument The document of the import.
* @return The newly created import element.
*/
public Import createWSDLImport(WSDLDocument wsdlDocument)
{
if(importDef != null)
{
return importDef;
}
importDef = getNewImport();
if (importDef != null)
{
importDef.setDefinition(wsdlDocument.getDefinition());
schemas.addAll(wsdlDocument.getSchemas());
importingWSDLDoc.addSchemas(schemas);
}
return importDef;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-wsdlgen
private static boolean addImport(QName name,
Class type,
WSDLDefinition wsdlDef,
Definition newDef,
List<WSDLDefinition> imports) {
String namespace = name.getNamespaceURI();
if (newDef.getImports(namespace) == null) {
WSDLDefinition impDef = findDefinition(wsdlDef, name, type);
if (impDef != null) {
Import imp = newDef.createImport();
imp.setNamespaceURI(namespace);
imp.setLocationURI(impDef.getURI().toString());
imp.setDefinition(impDef.getDefinition());
newDef.addNamespace("ns" + imports.size(), namespace);
newDef.addImport(imp);
imports.add(impDef);
return true;
} else {
// import was not added because element not found
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
private static boolean addImport(QName name,
Class type,
WSDLDefinition wsdlDef,
Definition newDef,
List<WSDLDefinition> imports) {
String namespace = name.getNamespaceURI();
if (newDef.getImports(namespace) == null) {
WSDLDefinition impDef = findDefinition(wsdlDef, name, type);
if (impDef != null) {
Import imp = newDef.createImport();
imp.setNamespaceURI(namespace);
imp.setLocationURI(impDef.getURI().toString());
imp.setDefinition(impDef.getDefinition());
newDef.addNamespace("ns" + imports.size(), namespace);
newDef.addImport(imp);
imports.add(impDef);
return true;
} else {
// import was not added because element not found
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl
WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy, context);
if (resolved != null && !resolved.isUnresolved()) {
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
try {
resolved = read(null, uri, uri.toURL(), context);
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
try {
resolved = read(null, locationURI, locationURI.toURL(), context);
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
代码示例来源:origin: org.apache.servicemix/servicemix-common
public static Definition createImportDef(Definition definition, String targetNamespace, String importUri)
throws Exception {
// Create definition
Definition def = WSDLFactory.newInstance().newDefinition();
def.setTargetNamespace(targetNamespace);
// Add namespaces
Map<?, ?> namespaces = definition.getNamespaces();
for (Iterator<?> iter = namespaces.keySet().iterator(); iter.hasNext();) {
String prefix = (String) iter.next();
String uri = definition.getNamespace(prefix);
def.addNamespace(prefix, uri);
}
def.addNamespace("tns", targetNamespace);
def.addNamespace("tnspt", definition.getTargetNamespace());
// Create import
Import imp = def.createImport();
imp.setNamespaceURI(definition.getTargetNamespace());
imp.setLocationURI(importUri);
imp.setDefinition(definition);
def.addImport(imp);
return def;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy, context);
if (resolved != null && !resolved.isUnresolved()) {
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
try {
resolved = read(null, uri, uri.toURL(), context);
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
try {
resolved = read(null, locationURI, locationURI.toURL(), context);
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
javax.wsdl.Import imp = facade.createImport();
imp.setNamespaceURI(d.getNamespace());
imp.setDefinition(d.getDefinition());
imp.setLocationURI(d.getDefinition().getDocumentBaseURI());
facade.addImport(imp);
代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl
javax.wsdl.Import imp = facade.createImport();
imp.setNamespaceURI(d.getNamespace());
imp.setDefinition(d.getDefinition());
imp.setLocationURI(d.getDefinition().getDocumentBaseURI());
facade.addImport(imp);
代码示例来源:origin: org.apache.cxf/cxf-rt-core
Import wsdlImport = definition.createImport();
String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
代码示例来源:origin: org.wso2.wsdl4j/wsdl4j
importDef.setDefinition(importedDef);
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
importDef.setDefinition(importedDef);
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
import1.setDefinition(definition1);
代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi
import1.setDefinition(definition1);
代码示例来源:origin: apache/cxf
Import wsdlImport = definition.createImport();
String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
Import wsdlImport = definition.createImport();
String tns = service.getInterface().getName().getNamespaceURI();
wsdlImport.setDefinition(portTypeDef);
wsdlImport.setNamespaceURI(tns);
wsdlImport.setLocationURI(service.getInterface().getName().getLocalPart() + ".wsdl");
内容来源于网络,如有侵权,请联系作者删除!