myserviceservicetestcase.java

来自「Java有关XML编程需要用到axis 的源代码 把里面bin下的包导入相应」· Java 代码 · 共 46 行

JAVA
46
字号
/** * MyServiceServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2alpha Dec 06, 2003 (10:46:24 EST) WSDL2Java emitter. */package test.wsdl.date;public class MyServiceServiceTestCase extends junit.framework.TestCase {    public MyServiceServiceTestCase(java.lang.String name) {        super(name);    }    public void testtestdateWSDL() throws Exception {        javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();        java.net.URL url = new java.net.URL(new test.wsdl.date.MyServiceServiceLocator().gettestdateAddress() + "?WSDL");        javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.date.MyServiceServiceLocator().getServiceName());        assertTrue(service != null);    }    public void test1testdateGetInfo() throws Exception {        test.wsdl.date.TestdateSoapBindingStub binding;        try {            binding = (test.wsdl.date.TestdateSoapBindingStub)                          new test.wsdl.date.MyServiceServiceLocator().gettestdate();        }        catch (javax.xml.rpc.ServiceException jre) {            if(jre.getLinkedCause()!=null)                jre.getLinkedCause().printStackTrace();            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);        }        assertNotNull("binding is null", binding);        // Time out after a minute        binding.setTimeout(60000);        // Test operation        test.wsdl.date.MyBean value = null;        value = binding.getInfo();        // TBD - validate results        System.out.println(value.getDate());    }}

⌨️ 快捷键说明

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