📄 bookservicetest.java
字号:
package org.codehaus.xfire.demo;import org.codehaus.xfire.XFire;import org.codehaus.xfire.aegis.AbstractXFireAegisTest;import org.codehaus.xfire.client.XFireProxyFactory;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.service.ServiceFactory;import org.codehaus.xfire.service.binding.ObjectServiceFactory;import org.codehaus.xfire.service.invoker.ObjectInvoker;/** * @author <a href="mailto:nathanyp@hotmail.com">Nathan Peles</a> */public class BookServiceTest extends AbstractXFireAegisTest{ public void setUp() throws Exception { super.setUp(); // Register the web service. XFire xfire = getXFire(); ServiceFactory factory = new ObjectServiceFactory(xfire.getTransportManager(), null); Service service = factory.create(BookService.class); service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, BookServiceImpl.class); xfire.getServiceRegistry().register(service); } public void testClient() throws Exception { Service serviceModel = getXFire().getServiceRegistry().getService("BookService"); XFireProxyFactory serviceFactory = new XFireProxyFactory(getXFire()); // Connect to web service. BookService service = (BookService) serviceFactory.create(serviceModel, "xfire.local://BookService"); assertNotNull(service); // Call web service. Book[] books = service.getBooks(); assertNotNull(books); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -