Java Code Examples for com.sun.xml.internal.ws.api.server.SDDocumentSource#create()

The following examples show how to use com.sun.xml.internal.ws.api.server.SDDocumentSource#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WSDLGenResolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: MexEntityResolver.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
        }
    }
}
 
Example 3
Source File: MexEntityResolver.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
        }
    }
}
 
Example 4
Source File: WSDLGenResolver.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 5
Source File: WSDLGenResolver.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 6
Source File: MexEntityResolver.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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);
        }
    }
}
 
Example 7
Source File: WSDLGenResolver.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 8
Source File: WSDLGenResolver.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 9
Source File: AbstractSchemaValidationTube.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SDDocument resolve(String systemId) {
    SDDocument sdi = docs.get(systemId);
    if (sdi == null) {
        SDDocumentSource sds;
        try {
            sds = SDDocumentSource.create(new URL(systemId));
        } catch(MalformedURLException e) {
            throw new WebServiceException(e);
        }
        sdi = SDDocumentImpl.create(sds, new QName(""), new QName(""));
        docs.put(systemId, sdi);
    }
    return sdi;
}
 
Example 10
Source File: WSDLGenResolver.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 11
Source File: WSDLGenResolver.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source File: WSDLGenResolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 13
Source File: WSDLGenResolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 14
Source File: WSDLGenResolver.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 15
Source File: AbstractSchemaValidationTube.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SDDocument resolve(String systemId) {
    SDDocument sdi = docs.get(systemId);
    if (sdi == null) {
        SDDocumentSource sds;
        try {
            sds = SDDocumentSource.create(new URL(systemId));
        } catch(MalformedURLException e) {
            throw new WebServiceException(e);
        }
        sdi = SDDocumentImpl.create(sds, new QName(""), new QName(""));
        docs.put(systemId, sdi);
    }
    return sdi;
}
 
Example 16
Source File: WSDLGenResolver.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 17
Source File: WSDLGenResolver.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 18
Source File: AbstractSchemaValidationTube.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SDDocument resolve(String systemId) {
    SDDocument sdi = docs.get(systemId);
    if (sdi == null) {
        SDDocumentSource sds;
        try {
            sds = SDDocumentSource.create(new URL(systemId));
        } catch(MalformedURLException e) {
            throw new WebServiceException(e);
        }
        sdi = SDDocumentImpl.create(sds, new QName(""), new QName(""));
        docs.put(systemId, sdi);
    }
    return sdi;
}
 
Example 19
Source File: WSDLGenResolver.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 20
Source File: AbstractSchemaValidationTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SDDocument resolve(String systemId) {
    SDDocument sdi = docs.get(systemId);
    if (sdi == null) {
        SDDocumentSource sds;
        try {
            sds = SDDocumentSource.create(new URL(systemId));
        } catch(MalformedURLException e) {
            throw new WebServiceException(e);
        }
        sdi = SDDocumentImpl.create(sds, new QName(""), new QName(""));
        docs.put(systemId, sdi);
    }
    return sdi;
}