⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multipleschemainnstest.java

📁 Xfire文件 用于开发web service 的一个开源工具 很好用的
💻 JAVA
字号:
package org.codehaus.xfire.xmlbeans;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.soap.SoapConstants;import org.codehaus.xfire.wsdl.AbstractWSDL;import org.jdom.Document;/** * Tests that we can handle multiple schemas within the same namespace. * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a> */public class MultipleSchemaInNSTest        extends AbstractXmlBeansTest{    private Service endpoint;    String ns = "urn:xfire:xmlbeans:nstest";    public void setUp()            throws Exception    {        super.setUp();        endpoint = getServiceFactory().create(MultipleSchemaService.class,                                              null,                                              ns,                                              null);                            getServiceRegistry().register(endpoint);    }    public void testWSDL() throws Exception    {        Document wsdl = getWSDLDocument("MultipleSchemaService");        addNamespace("xsd", SoapConstants.XSD);        assertValid("//xsd:schema[@targetNamespace='" + ns + "'][1]", wsdl);        assertValid("//xsd:schema[@targetNamespace='" + ns + "'][1]/xsd:import[@namespace='" + ns + "']", wsdl);        assertInvalid("//xsd:schema[@targetNamespace='" + ns + "']" +                "[1]/xsd:import[@namespace='" + ns + "'][@schemaLocation]", wsdl);        assertValid("//xsd:schema[@targetNamespace='" + ns + "'][2]", wsdl);        assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][2]/xsd:import[@namespace='" + ns + "']", wsdl);        assertValid("//xsd:schema[@targetNamespace='" + ns + "'][3]", wsdl);        assertValid("//xsd:schema[@targetNamespace='" + ns + "'][3]/xsd:import[@namespace='" + ns + "']", wsdl);                endpoint.setProperty(AbstractWSDL.REMOVE_ALL_IMPORTS, "True");                wsdl = getWSDLDocument("MultipleSchemaService");                assertValid("//xsd:schema[@targetNamespace='" + ns + "'][1]", wsdl);        assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][1]" +                "/xsd:import[@namespace='" + ns + "']", wsdl);        assertValid("//xsd:schema[@targetNamespace='" + ns + "'][3]", wsdl);        assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][3]" +                "/xsd:import[@namespace='" + ns + "']", wsdl);    }}

⌨️ 快捷键说明

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