resolverwsdllocator.java

来自「Xfire文件 用于开发web service 的一个开源工具 很好用的」· Java 代码 · 共 96 行

JAVA
96
字号
package org.codehaus.xfire.wsdl11;import java.io.IOException;import java.io.InputStream;import javax.wsdl.xml.WSDLLocator;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.codehaus.xfire.util.Resolver;import org.xml.sax.InputSource;/** * A WSDL resource locator. *  * @author <a href="mailto:dlaprade@gmail.com">Daniel LaPrade</a> *  */public class ResolverWSDLLocator    implements WSDLLocator{    private static final Log LOG = LogFactory.getLog(ResolverWSDLLocator.class.getName());    private String baseURI;    private String lastimport = "";    private InputSource inputsource = null;    public ResolverWSDLLocator(String baseURI, InputSource inputsource)    {        this.inputsource = inputsource;        this.baseURI = baseURI;    }    /*     * (non-Javadoc)     *      * @see javax.wsdl.xml.WSDLLocator#getBaseInputSource()     */    public InputSource getBaseInputSource()    {        return inputsource;    }    /*     * (non-Javadoc)     *      * @see javax.wsdl.xml.WSDLLocator#getBaseURI()     */    public String getBaseURI()    {        return baseURI;    }    /*     * (non-Javadoc)     *      * @see javax.wsdl.xml.WSDLLocator#getImportInputSource(java.lang.String,     *      java.lang.String)     */    public InputSource getImportInputSource(String arg0, String name)    {        Resolver resolver;        InputSource result = null;        // Set the last imported value.        lastimport = name;        try        {            resolver = new Resolver(baseURI, name);            InputStream is = resolver.getInputStream();            if (is != null)                result = new InputSource(resolver.getInputStream());        }        catch (IOException e)        {            LOG.warn("Source: " + name + " failed to find input source with exception: ", e);        }        return result;    }    /*     * (non-Javadoc)     *      * @see javax.wsdl.xml.WSDLLocator#getLatestImportURI()     */    public String getLatestImportURI()    {        return lastimport;    }    public void close() { }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?