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

📄 voidtest.java

📁 Xfire文件 用于开发web service 的一个开源工具 很好用的
💻 JAVA
字号:
package org.codehaus.xfire.message.wrapped;import org.codehaus.xfire.aegis.AbstractXFireAegisTest;import org.codehaus.xfire.service.OperationInfo;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.services.VoidService;import org.codehaus.xfire.soap.SoapConstants;import org.codehaus.xfire.wsdl.WSDLWriter;import org.jdom.Document;/** * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a> * @since Dec 20, 2004 */public class VoidTest        extends AbstractXFireAegisTest{    public void setUp()            throws Exception    {        super.setUp();        Service endpoint = getServiceFactory().create(VoidService.class);        getServiceRegistry().register(endpoint);    }    public void testVoidSync()            throws Exception    {        Document response =                invokeService("VoidService",                              "/org/codehaus/xfire/message/wrapped/voidRequest.xml");        addNamespace("sb", "http://services.xfire.codehaus.org");        assertValid("/s:Envelope/s:Body/sb:doNothingResponse", response);    }    public void testVoidAsync()            throws Exception    {        Service endpoint = getServiceRegistry().getService("VoidService");        OperationInfo op = endpoint.getServiceInfo().getOperation("doNothing");        op.setAsync(true);        op.setMEP(SoapConstants.MEP_IN);        op.setOutputMessage(null);                Document response =                invokeService("VoidService",                              "/org/codehaus/xfire/message/wrapped/voidRequest.xml");        assertNull(response);    }    public void testSyncWSDL()            throws Exception    {        Document doc = getWSDLDocument("VoidService");        addNamespace("wsdl", WSDLWriter.WSDL11_NS);        addNamespace("wsdlsoap", WSDLWriter.WSDL11_SOAP_NS);        addNamespace("xsd", SoapConstants.XSD);        assertValid("//xsd:schema/xsd:element[@name='doNothing']", doc);        assertValid("//xsd:schema/xsd:element[@name='doNothingResponse']", doc);        assertValid("//wsdl:portType/wsdl:operation[@name='doNothing']/wsdl:input", doc);        assertValid("//wsdl:portType/wsdl:operation[@name='doNothing']/wsdl:output", doc);        assertValid("//wsdl:binding/wsdl:operation[@name='doNothing']/wsdl:input", doc);        assertValid("//wsdl:binding/wsdl:operation[@name='doNothing']/wsdl:output", doc);    }    public void testAsyncWSDL()            throws Exception    {        Service endpoint = getServiceRegistry().getService("VoidService");        OperationInfo op = endpoint.getServiceInfo().getOperation("doNothing");        op.setAsync(true);        op.setMEP(SoapConstants.MEP_IN);        Document doc = getWSDLDocument("VoidService");        addNamespace("wsdl", WSDLWriter.WSDL11_NS);        addNamespace("wsdlsoap", WSDLWriter.WSDL11_SOAP_NS);        addNamespace("xsd", SoapConstants.XSD);        assertValid("//xsd:schema/xsd:element[@name='doNothing']", doc);        assertInvalid("//xsd:schema/xsd:element[@name='doNothingResponse']", doc);        assertValid("//wsdl:portType/wsdl:operation[@name='doNothing']/wsdl:input", doc);        assertInvalid("//wsdl:portType/wsdl:operation[@name='doNothing']/wsdl:output", doc);        assertValid("//wsdl:binding/wsdl:operation[@name='doNothing']/wsdl:input", doc);        assertInvalid("//wsdlbinding/wsdl:operation[@name='doNothing']/wsdl:output", doc);    }}

⌨️ 快捷键说明

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