当前位置: 首页>>代码示例>>Java>>正文


Java SDDocumentSource类代码示例

本文整理汇总了Java中com.sun.xml.internal.ws.api.server.SDDocumentSource的典型用法代码示例。如果您正苦于以下问题:Java SDDocumentSource类的具体用法?Java SDDocumentSource怎么用?Java SDDocumentSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SDDocumentSource类属于com.sun.xml.internal.ws.api.server包,在下文中一共展示了SDDocumentSource类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: collectDocs

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Get all the WSDL & schema documents recursively.
 */
private void collectDocs(String dirPath) throws MalformedURLException {
    Set<String> paths = loader.getResourcePaths(dirPath);
    if (paths != null) {
        for (String path : paths) {
            if (path.endsWith("/")) {
                if (path.endsWith("/CVS/") || path.endsWith("/.svn/")) {
                    continue;
                }
                collectDocs(path);
            } else {
                URL res = loader.getResource(path);
                docs.put(res.toString(), SDDocumentSource.create(res));
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DeploymentDescriptorParser.java

示例2: getSchemaOutput

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Updates filename if the suggested filename need to be changed in
 * xsd:import. If there is already a schema document for the namespace
 * in the metadata, then it is not generated.
 *
 * return null if schema need not be generated
 *        Result the generated schema document
 */
public Result getSchemaOutput(String namespace, Holder<String> filename) {
    List<SDDocumentImpl> schemas = nsMapping.get(namespace);
    if (schemas != null) {
        if (schemas.size() > 1) {
            throw new ServerRtException("server.rt.err",
                "More than one schema for the target namespace "+namespace);
        }
        filename.value = schemas.get(0).getURL().toExternalForm();
        return null;            // Don't generate schema
    }

    URL url = createURL(filename.value);
    MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
    xsb.setSystemId(url.toExternalForm());
    SDDocumentSource sd = SDDocumentSource.create(url,xsb);
    newDocs.add(sd);

    XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
    r.setSystemId(filename.value);
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:WSDLGenResolver.java

示例3: createSEIModel

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
private static AbstractSEIModelImpl createSEIModel(WSDLPort wsdlPort,
                                                   Class<?> implType, @NotNull QName serviceName, @NotNull QName portName, WSBinding binding,
                                                   SDDocumentSource primaryWsdl) {
            DatabindingFactory fac = DatabindingFactory.newInstance();
            DatabindingConfig config = new DatabindingConfig();
            config.setEndpointClass(implType);
            config.getMappingInfo().setServiceName(serviceName);
            config.setWsdlPort(wsdlPort);
            config.setWSBinding(binding);
            config.setClassLoader(implType.getClassLoader());
            config.getMappingInfo().setPortName(portName);
            if (primaryWsdl != null) config.setWsdlURL(primaryWsdl.getSystemId());
    config.setMetadataReader(getExternalMetadatReader(implType, binding));

            com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);
            return (AbstractSEIModelImpl) rt.getModel();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:EndpointFactory.java

示例4: verifyPrimaryWSDL

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Verifies whether the given primaryWsdl contains the given serviceName.
 * If the WSDL doesn't have the service, it throws an WebServiceException.
 */
private static void verifyPrimaryWSDL(@NotNull SDDocumentSource primaryWsdl, @NotNull QName serviceName) {
    SDDocumentImpl primaryDoc = SDDocumentImpl.create(primaryWsdl,serviceName,null);
    if (!(primaryDoc instanceof SDDocument.WSDL)) {
        throw new WebServiceException(primaryWsdl.getSystemId()+
                " is not a WSDL. But it is passed as a primary WSDL");
    }
    SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)primaryDoc;
    if (!wsdlDoc.hasService()) {
        if(wsdlDoc.getAllServices().isEmpty())
            throw new WebServiceException("Not a primary WSDL="+primaryWsdl.getSystemId()+
                    " since it doesn't have Service "+serviceName);
        else
            throw new WebServiceException("WSDL "+primaryDoc.getSystemId()
                    +" has the following services "+wsdlDoc.getAllServices()
                    +" but not "+serviceName+". Maybe you forgot to specify a serviceName and/or targetNamespace in @WebService/@WebServiceProvider?");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:EndpointFactory.java

示例5: resolveEntity

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException {
    if (systemId != null) {
        SDDocumentSource doc = metadata.get(systemId);
        if (doc != null)
            return new Parser(doc);
    }
    if (resolver != null) {
        try {
            InputSource source = resolver.resolveEntity(publicId, systemId);
            if (source != null) {
                Parser p = new Parser(null, XMLStreamReaderFactory.create(source, true));
                return p;
            }
        } catch (SAXException e) {
            throw new XMLStreamException(e);
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:EndpointFactory.java

示例6: MexEntityResolver

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
public MexEntityResolver(List<? extends Source> wsdls) throws IOException {
    Transformer transformer = XmlUtil.newTransformer();
    for (Source source : wsdls) {
        XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
        try {
            transformer.transform(source, xsbr);
        } catch (TransformerException e) {
            throw new WebServiceException(e);
        }
        String systemId = source.getSystemId();

        //TODO: can we do anything if the given mex Source has no systemId?
        if(systemId != null){
            SDDocumentSource doc = SDDocumentSource.create(JAXWSUtils.getFileOrURL(systemId), xsbr.getXMLStreamBuffer());
            this.wsdls.put(systemId, doc);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:MexEntityResolver.java

示例7: collectDocs

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Get all the WSDL & schema documents recursively.
 */
private void collectDocs(String dirPath) throws MalformedURLException {
    Set<String> paths = loader.getResourcePaths(dirPath);
    if (paths != null) {
        for (String path : paths) {
            if (path.endsWith("/")) {
                if(path.endsWith("/CVS/") || path.endsWith("/.svn/"))
                    continue;
                collectDocs(path);
            } else {
                URL res = loader.getResource(path);
                docs.put(res.toString(),SDDocumentSource.create(res));
            }
        }
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:19,代码来源:DeploymentDescriptorParser.java

示例8: getPrimaryWSDL

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Checks the deployment descriptor or {@link @WebServiceProvider} annotation
 * to see if it points to any WSDL. If so, returns the {@link SDDocumentSource}.
 *
 * @return The pointed WSDL, if any. Otherwise null.
 */
private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class<?> implementorClass, MetadataReader metadataReader) {

    String wsdlFile = getAttribute(attrs, ATTR_WSDL);
    if (wsdlFile == null) {
        wsdlFile = EndpointFactory.getWsdlLocation(implementorClass, metadataReader);
    }

    if (wsdlFile != null) {
        if (!wsdlFile.startsWith(JAXWS_WSDL_DD_DIR)) {
            logger.log(Level.WARNING, "Ignoring wrong wsdl={0}. It should start with {1}. Going to generate and publish a new WSDL.", new Object[]{wsdlFile, JAXWS_WSDL_DD_DIR});
            return null;
        }

        URL wsdl;
        try {
            wsdl = loader.getResource('/' + wsdlFile);
        } catch (MalformedURLException e) {
            throw new LocatableWebServiceException(
                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr);
        }
        if (wsdl == null) {
            throw new LocatableWebServiceException(
                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr);
        }
        SDDocumentSource docInfo = docs.get(wsdl.toExternalForm());
        assert docInfo != null;
        return docInfo;
    }

    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:DeploymentDescriptorParser.java

示例9: getWSDL

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Generates the concrete WSDL that contains service element.
 *
 * @return Result the generated concrete WSDL
 */
public Result getWSDL(String filename) {
    URL url = createURL(filename);
    MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
    xsb.setSystemId(url.toExternalForm());
    concreteWsdlSource = SDDocumentSource.create(url,xsb);
    newDocs.add(concreteWsdlSource);
    XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
    r.setSystemId(filename);
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:WSDLGenResolver.java

示例10: getAbstractWSDL

import com.sun.xml.internal.ws.api.server.SDDocumentSource; //导入依赖的package包/类
/**
 * Updates filename if the suggested filename need to be changed in
 * wsdl:import. If the metadata already contains abstract wsdl(i.e. a WSDL
 * which has the porttype), then the abstract wsdl shouldn't be generated
 *
 * return null if abstract WSDL need not be generated
 *        Result the abstract WSDL
 */
public Result getAbstractWSDL(Holder<String> filename) {
    if (abstractWsdl != null) {
        filename.value = abstractWsdl.getURL().toString();
        return null;                // Don't generate abstract WSDL
    }
    URL url = createURL(filename.value);
    MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
    xsb.setSystemId(url.toExternalForm());
    SDDocumentSource abstractWsdlSource = SDDocumentSource.create(url,xsb);
    newDocs.add(abstractWsdlSource);
    XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
    r.setSystemId(filename.value);
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WSDLGenResolver.java


注:本文中的com.sun.xml.internal.ws.api.server.SDDocumentSource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。