本文整理汇总了Java中javax.wsdl.Types类的典型用法代码示例。如果您正苦于以下问题:Java Types类的具体用法?Java Types怎么用?Java Types使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Types类属于javax.wsdl包,在下文中一共展示了Types类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importTypes
import javax.wsdl.Types; //导入依赖的package包/类
/**
* Import the Types from the WSDL definition using the same strategy that Cxf uses taking advantage of JAXB
*/
protected void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
Element rootTypes = this.getRootTypes();
this.createDefaultStructures(rootTypes);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, rootTypes);
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings) {
this.importStructure(mapping);
}
}
示例2: parseWSDLTypes
import javax.wsdl.Types; //导入依赖的package包/类
private void parseWSDLTypes( XSOMParser schemaParser )
throws IOException
{
Definition definition = getWSDLDefinition();
if ( definition != null ) {
Types types = definition.getTypes();
if ( types != null ) {
List<ExtensibilityElement> list = types.getExtensibilityElements();
for( ExtensibilityElement element : list ) {
if ( element instanceof SchemaImpl ) {
Element schemaElement = ((SchemaImpl) element).getElement();
Map<String, String> namespaces = definition.getNamespaces();
for( Entry<String, String> entry : namespaces.entrySet() ) {
if ( entry.getKey().equals( "xmlns" ) || entry.getKey().trim().isEmpty() ) {
continue;
}
if ( schemaElement.getAttribute( "xmlns:" + entry.getKey() ).isEmpty() ) {
schemaElement.setAttribute( "xmlns:" + entry.getKey(), entry.getValue() );
}
}
parseSchemaElement( definition, schemaElement, schemaParser );
}
}
}
}
}
示例3: importTypes
import javax.wsdl.Types; //导入依赖的package包/类
/**
* Import the Types from the WSDL definition using the same strategy that
* Cxf uses taking advantage of JAXB
*/
private void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
Element rootTypes = this.getRootTypes();
this.createDefaultStructures(rootTypes);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, rootTypes);
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings){
this.importStructure(mapping);
}
}
示例4: getExtensibilityElements
import javax.wsdl.Types; //导入依赖的package包/类
private static List<ExtensibilityElement> getExtensibilityElements(Definition definition) {
List<ExtensibilityElement> elements = new ArrayList<ExtensibilityElement>();
Types types = definition.getTypes();
if (types != null) {
elements.addAll(definition.getExtensibilityElements());
elements.addAll(types.getExtensibilityElements());
}
Iterator<List<Import>> wsdlImports = definition.getImports().values().iterator();
while (wsdlImports.hasNext()) {
List<Import> imports = wsdlImports.next();
int size = imports.size();
for (int i = 0; i < size; i++) {
elements.addAll(getExtensibilityElements(imports.get(i).getDefinition()));
}
}
return elements;
}
示例5: buildTypes
import javax.wsdl.Types; //导入依赖的package包/类
public Types buildTypes(Document document, Definition def, Map<String, Object> refs) {
Types types = def.createTypes();
Element schema = document.createElement("xsd:schema");
schema.setAttribute("targetNamespace", TNS);
types.setDocumentationElement(schema);
Element inParams = document.createElement("xsd:element");
inParams.setAttribute("name", this.name);
Element inParamsCT = document.createElement("xsd:complexType");
Element inParamsSQ = document.createElement("xsd:all");
inParamsCT.appendChild(inParamsSQ);
inParams.appendChild(inParamsCT);
refs.put("in", inParamsSQ);
Element outParams = document.createElement("xsd:element");
outParams.setAttribute("name", this.name + "Response");
Element outParamsCT = document.createElement("xsd:complexType");
Element outParamsSQ = document.createElement("xsd:all");
outParamsCT.appendChild(outParamsSQ);
outParams.appendChild(outParamsCT);
addSystemOutParams(outParamsSQ);
refs.put("out", outParamsSQ);
schema.appendChild(inParams);
schema.appendChild(outParams);
return types;
}
示例6: releaseResources
import javax.wsdl.Types; //导入依赖的package包/类
public void releaseResources() {
if (wsdlDefinition != null) {
Types types = wsdlDefinition.getTypes();
if (types != null) {
wsdlDefinition.setTypes(null);
}
this.setCachedTypes(types);
Element element = wsdlDefinition.getDocumentationElement();
if (element != null) {
wsdlDefinition.setDocumentationElement(null);
}
this.setCachedDocElement(element);
}
}
示例7: createTypes
import javax.wsdl.Types; //导入依赖的package包/类
public Types createTypes() {
if (isDebugEnabled) {
log.debug(myClassName + ".createTypes()");
}
getWrappedDefinitionForUse();
Types results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.createTypes();
}
doneUsingWrappedDefinition();
return results;
}
示例8: importTypes
import javax.wsdl.Types; //导入依赖的package包/类
private void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
List<?> implementationTypes = types.getExtensibilityElements();
if (implementationTypes.size() == 0) {
return;
}
SchemaImpl impl = (SchemaImpl) implementationTypes.get(0);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
intermediateModel.generateCode(null, elForRun);
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings){
this.importStructure(mapping);
}
}
示例9: extractTypesSchema
import javax.wsdl.Types; //导入依赖的package包/类
public static org.jdom.Element extractTypesSchema(Definition wsdlDefinition) {
org.jdom.Element typesSchemaElm = null;
if (wsdlDefinition != null) {
Types types = wsdlDefinition.getTypes();
if (types != null) {
List extensibilityElements = types.getExtensibilityElements();
for (int i = 0; i < extensibilityElements.size(); i++) {
ExtensibilityElement schemaExtElem = (ExtensibilityElement) extensibilityElements.get(i);
if (schemaExtElem != null) {
QName elementType = schemaExtElem.getElementType();
if (elementType.getLocalPart().equals("schema")
&& (schemaExtElem instanceof UnknownExtensibilityElement)) {
Element element = ((UnknownExtensibilityElement) schemaExtElem).getElement();
DOMBuilder domBuilder = new DOMBuilder();
typesSchemaElm = domBuilder.build(element);
}
}
}
}
}
return typesSchemaElm;
}
示例10: importTypes
import javax.wsdl.Types; //导入依赖的package包/类
protected void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
SchemaImpl impl = (SchemaImpl) types.getExtensibilityElements().get(0);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings) {
this.importStructure(mapping);
}
}
示例11: addMarkAsUpdatedStatement
import javax.wsdl.Types; //导入依赖的package包/类
/**
* Fills {@link #newIssueToChangesetStatement()} by parameters for next batch.
*
* @param statement
* @param unique
* @throws SQLException
*/
private void addMarkAsUpdatedStatement(PreparedStatement statement, ChangesetResult unique) throws SQLException
{
statement.setInt(1, 0);
statement.setNull(2, Types.STRING_TYPE);
statement.setNull(3, Types.STRING_TYPE);
statement.setInt(4, unique.id);
statement.addBatch();
}
示例12: setSchemaDocIntoWSDLTypes
import javax.wsdl.Types; //导入依赖的package包/类
public void setSchemaDocIntoWSDLTypes(Document doc) {
try {
Types wsdl_types = localDef.createTypes();
Schema typesExt = (Schema) extensionRegistry.createExtension(Types.class, new QName(NameSpacesEnum.XML_SCH.getNameSpaceURI(), "schema"));
typesExt.setElement((Element) doc.getFirstChild());
wsdl_types.addExtensibilityElement(typesExt);
localDef.setTypes(wsdl_types);
} catch (Exception ex) {
System.err.println(ex.getMessage());
}
}
示例13: importTypes
import javax.wsdl.Types; //导入依赖的package包/类
private void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
SchemaImpl impl = (SchemaImpl) types.getExtensibilityElements().get(0);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings){
this.importStructure(mapping);
}
}
示例14: generateTypes
import javax.wsdl.Types; //导入依赖的package包/类
/**
* generates the schemas for the wsdl
*
* @throws SchemaGenerationException
*/
private void generateTypes() throws SchemaGenerationException {
Types types = this.wsdlDefinition.createTypes();
this.wsdlDefinition.setTypes(types);
XmlSchema xmlSchema;
for (Iterator iter = this.service.getSchemaMap().values().iterator(); iter.hasNext();) {
xmlSchema = (XmlSchema) iter.next();
xmlSchema.generateWSDLSchema();
types.addExtensibilityElement(xmlSchema.getWsdlSchema());
}
}
示例15: readPackagesFromSchema
import javax.wsdl.Types; //导入依赖的package包/类
public Set<String> readPackagesFromSchema(Definition wsdlDefinition)
throws SchemaReaderException {
if (wsdlDefinition == null) {
if (log.isDebugEnabled()) {
log.debug("Invalid wsdl definition provided, NULL");
}
throw new SchemaReaderException(Messages.getMessage("SchemaReaderErr1"));
}
this.wsdlDefinition = wsdlDefinition;
List<Schema> schemaList = new ArrayList<Schema>();
Set<String> packageList = new TreeSet<String>();
//Add WSDL TargetNamespace
String namespace = wsdlDefinition.getTargetNamespace();
List packages = JavaUtils.getPackagesFromNamespace(namespace);
if (packages != null && packages.size() > 0) {
packageList.addAll(packages);
}
//Read All Schema Definition in wsdl;
Types types = wsdlDefinition.getTypes();
if (types == null) {
if (log.isDebugEnabled()) {
log.debug("WARNING: Could not find any Schema/Types from WSDL");
log.debug("no packages will derived from WSDL schema");
}
return packageList;
}
List extensibilityElements = types.getExtensibilityElements();
for (Object obj : extensibilityElements) {
if (obj != null && isSchema((ExtensibilityElement)obj)) {
Schema schema = (Schema)obj;
//process schemas and read packages from them.
processSchema(schema, schemaList, packageList);
}
}
//Set always stores unique objects, so I dont have to worry about removing duplicates from this set.
return packageList;
}