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

📄 pojotest.java

📁 Xfire文件 用于开发web service 的一个开源工具 很好用的
💻 JAVA
字号:
package org.codehaus.xfire.jaxb2;import javax.xml.bind.annotation.XmlType;import org.codehaus.xfire.client.XFireProxyFactory;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.service.binding.ObjectServiceFactory;import org.codehaus.xfire.soap.SoapConstants;import org.codehaus.xfire.test.AbstractXFireTest;import org.codehaus.xfire.wsdl11.builder.WSDLBuilder;import org.jdom.Document;/** * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a> */public class POJOTest        extends AbstractXFireTest{    private Service endpoint;    private ObjectServiceFactory builder;    public void setUp()            throws Exception    {        super.setUp();        builder = new JaxbServiceFactory();        endpoint = builder.create(AccountServiceImpl.class);        endpoint.setProperty(WSDLBuilder.REMOVE_ALL_IMPORTS, "true");        getServiceRegistry().register(endpoint);    }    public void testClientAndHeaders() throws Exception    {        AccountService client = (AccountService)             new XFireProxyFactory(getXFire()).create(endpoint, "xfire.local://AccountService");                client.auth("123", "text");    }            public void testWsdl() throws Exception    {        Document doc = getWSDLDocument("AccountService");        addNamespace("xsd", SoapConstants.XSD);                assertValid("//xsd:schema[@targetNamespace='urn:account']/xsd:complexType[@name='Acct']", doc);        assertInvalid("//xsd:import", doc);    }        @XmlType(name="Acct", namespace="urn:account")    public static class Account    {        private String id;        private Customer customer;                public String getId()        {            return id;        }        public void setId(String id)        {            this.id = id;        }        public Customer getCustomer()        {            return customer;        }        public void setCustomer(Customer customer)        {            this.customer = customer;        }                    }        @XmlType(name="Customer", namespace="urn:customer")    public static class Customer    {        private String id;        public String getId()        {            return id;        }        public void setId(String id)        {            this.id = id;        }            }}

⌨️ 快捷键说明

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