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

📄 wrappedstyletest.java

📁 Xfire文件 用于开发web service 的一个开源工具 很好用的
💻 JAVA
字号:
package org.codehaus.xfire.xmlbeans;import javax.xml.namespace.QName;import org.codehaus.xfire.service.MessagePartInfo;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.service.binding.ObjectServiceFactory;import org.codehaus.xfire.soap.SoapConstants;import org.jdom.Document;/** * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a> */public class WrappedStyleTest        extends AbstractXmlBeansTest{    private Service endpoint;    private ObjectServiceFactory factory;    public void setUp()            throws Exception    {        super.setUp();        factory = (ObjectServiceFactory) getServiceFactory();        factory.setStyle(SoapConstants.STYLE_WRAPPED);                endpoint = factory.create(TestService.class,                                  "TestService",                                  "urn:TestService",                                  null);                getServiceRegistry().register(endpoint);    }        public void testParams() throws Exception    {        MessagePartInfo info = (MessagePartInfo)            endpoint.getServiceInfo().getOperation("GetWeatherByZipCode").getInputMessage().getMessageParts().get(0);        assertEquals(new QName("http://codehaus.org/xfire/xmlbeans", "request"), info.getName());    }    public void testInvoke() throws Exception    {        Document response = invokeService("TestService", "/org/codehaus/xfire/xmlbeans/WrappedRequest.xml");                assertNotNull(response);        addNamespace("t", "urn:TestService");        addNamespace("x", "http://codehaus.org/xfire/xmlbeans");        assertValid("//t:mixedRequestResponse/x:response/x:form", response);    }        public void testFault() throws Exception    {        Document response = invokeService("TestService", "/org/codehaus/xfire/xmlbeans/FaultRequest.xml");                assertNotNull(response);        addNamespace("t", "urn:TestService");        addNamespace("x", "http://codehaus.org/xmlbeans/exception");        assertValid("//detail/t:CustomFault[@x:extraInfo='extra']", response);    }        public void testWSDL() throws Exception    {        Document wsdl = getWSDLDocument("TestService");        addNamespace("xsd", SoapConstants.XSD);        assertValid("//xsd:schema[@targetNamespace='urn:TestService']" +                "/xsd:element[@name='mixedRequest']" +                "//xsd:element[@name='string'][@type='xsd:string']", wsdl);        assertValid("//xsd:schema[@targetNamespace='urn:TestService']" +                    "/xsd:element[@name='mixedRequest']" +                    "//xsd:element[@ref='ns1:request']", wsdl);        assertValid("//xsd:schema[@targetNamespace='http://codehaus.org/xmlbeans/exception']" +                    "/xsd:complexType[@name='CustomFault']" +                    "/xsd:attribute[@name='extraInfo']", wsdl);            }}

⌨️ 快捷键说明

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