echotest.java

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

JAVA
45
字号
package org.codehaus.xfire.rpclit;import org.codehaus.xfire.aegis.AbstractXFireAegisTest;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.service.binding.ObjectServiceFactory;import org.codehaus.xfire.services.Echo;import org.codehaus.xfire.soap.SoapConstants;import org.jdom.Document;public class EchoTest    extends AbstractXFireAegisTest{    private Service service;    protected void setUp()        throws Exception    {        super.setUp();                ObjectServiceFactory osf = (ObjectServiceFactory) getServiceFactory();        osf.setStyle(SoapConstants.STYLE_RPC);        service = osf.create(Echo.class, null, "urn:xfire:echo", null);        getServiceRegistry().register(service);    }    public void testService() throws Exception    {        Document response = invokeService("Echo", "echo.xml");        addNamespace("e", "urn:xfire:echo");                assertValid("//out[text()='Yo Yo']", response);                response = invokeService("Echo", "echo-nil.xml");        assertValid("//out[@xsi:nil='true']", response);    }        public void testWSDL() throws Exception    {        getWSDLDocument(service.getSimpleName());    }}

⌨️ 快捷键说明

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