当前位置: 首页>>代码示例>>Java>>正文


Java Options.setUseSeparateListener方法代码示例

本文整理汇总了Java中org.apache.axis2.client.Options.setUseSeparateListener方法的典型用法代码示例。如果您正苦于以下问题:Java Options.setUseSeparateListener方法的具体用法?Java Options.setUseSeparateListener怎么用?Java Options.setUseSeparateListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.client.Options的用法示例。


在下文中一共展示了Options.setUseSeparateListener方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSoapOverUdpWithEchoService

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testSoapOverUdpWithEchoService() throws Exception {
    Options options = new Options();
    options.setTo(new EndpointReference("udp://127.0.0.1:3333?contentType=text/xml+soap"));
    options.setAction(Constants.AXIS2_NAMESPACE_URI + "/echoOMElement");
    options.setUseSeparateListener(true);
    options.setTimeOutInMilliSeconds(Long.MAX_VALUE);

    ServiceClient serviceClient = new ServiceClient(getClientCfgCtx(), null);
    serviceClient.setOptions(options);
    // We need to set up the anonymous service Axis uses to get the response
    AxisService clientService = serviceClient.getServiceContext().getAxisService();
    clientService.addParameter(UDPConstants.PORT_KEY, 4444);
    clientService.addParameter(UDPConstants.CONTENT_TYPE_KEY, "text/xml+soap");
    OMElement response = serviceClient.sendReceive(createPayload());
    
    assertEchoResponse(response);
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:18,代码来源:UDPTest.java

示例2: testEchoXMLCompleteSync

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLCompleteSync() throws Exception {
    OMFactory fac = OMAbstractFactory.getOMFactory();

    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement payloadElement = fac.createOMElement("echoOMElement", omNs);
    OMElement value = fac.createOMElement("myValue", omNs);
    value.setText("Isaac Asimov, The Foundation Trilogy");
    payloadElement.addChild(value);

    Options options = new Options();
    options.setTo(targetEPR);
    options.setAction(Constants.AXIS2_NAMESPACE_URI+"/"+operationName.getLocalPart());
    options.setTransportInProtocol(Constants.TRANSPORT_TCP);
    options.setUseSeparateListener(true);

    ServiceClient sender = new ServiceClient(configContext, clientService);
    sender.setOptions(options);
    OMElement result = sender.sendReceive(operationName, payloadElement);

    result.serialize(StAXUtils.createXMLStreamWriter(
            System.out));
    sender.cleanup();

}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:25,代码来源:TCPEchoRawXMLTest.java

示例3: testEchoXMLMultipleDuelSync

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLMultipleDuelSync() throws Exception {
    OMElement payload = TestingUtils.createDummyOMElement();
    Options options = new Options();
    options.setTo(targetEPR);

    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setUseSeparateListener(true);
    options.setTimeOutInMilliSeconds(50000);

    ConfigurationContext configContext =
            ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                    TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"),
                    TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo/conf/axis2.xml"));
    ServiceClient sender = new ServiceClient(configContext, null);
    options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
    options.setAction("urn:echoOMElement");
    sender.setOptions(options);

    for (int i = 0; i < 5; i++) {
        OMElement result = sender.sendReceive(payload);
        TestingUtils.compareWithCreatedOMElement(result);
    }
    sender.cleanup();
    configContext.terminate();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:EchoRawXMLMultipleSyncTest.java

示例4: testSaveAndRestoreOfMessage

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testSaveAndRestoreOfMessage() throws Exception {
    OMElement payload = TestingUtils.createDummyOMElement();
    Options options = new Options();
    options.setTo(TestConstants.targetEPR);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setAction(TestConstants.operationName.getLocalPart());
    options.setUseSeparateListener(true);

    ConfigurationContext configContext = UtilServer.createClientConfigurationContext();

    ServiceClient sender = new ServiceClient(configContext, null);
    sender.setOptions(options);
    sender.engageModule("addressing");

    OMElement result = sender.sendReceive(payload);

    TestingUtils.compareWithCreatedOMElement(result);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:MessageSaveAndRestoreTest.java

示例5: createClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
private ServiceClient createClient() throws Exception {
    Options options = new Options();
    options.setTo(targetEPR);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setAction(operationName.getLocalPart());
    options.setUseSeparateListener(true);
    options.setTimeOutInMilliSeconds(50000);

    ConfigurationContext configContext = UtilServer.createClientConfigurationContext();

    ServiceClient sender = new ServiceClient(configContext, null);
    sender.setOptions(options);
    sender.engageModule("addressing");
    return sender;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:PausingHandlerExecutionTest.java

示例6: testEchoXMLSyncSeperateListener

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLSyncSeperateListener() throws Exception {
    OMElement payload = createEnvelope();
    Options options = new Options();
    options.setTo(targetEPR);
    options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    ConfigurationContext configContext =
            ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                    TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);

    ServiceClient sender = new ServiceClient(configContext, null);
    sender.engageModule(new QName("addressing"));
    options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
    sender.setOptions(options);
    options.setUseSeparateListener(true);
    options.setTo(targetEPR);
    OMElement result = sender.sendReceive(payload);

    OMElement ele = (OMElement)result.getFirstOMChild();
    OMText binaryNode = (OMText)ele.getFirstOMChild();
    // to the assert equal
    compareWithCreatedOMText(binaryNode);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:EchoRawMTOMTest.java

示例7: cloneOptions

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public static Options cloneOptions(Options options) {

        // create new options object and set the parent
        Options clonedOptions = new Options(options.getParent());

        // copy general options
        clonedOptions.setCallTransportCleanup(options.isCallTransportCleanup());
        clonedOptions.setExceptionToBeThrownOnSOAPFault(options.isExceptionToBeThrownOnSOAPFault());
        clonedOptions.setManageSession(options.isManageSession());
        clonedOptions.setSoapVersionURI(options.getSoapVersionURI());
        clonedOptions.setTimeOutInMilliSeconds(options.getTimeOutInMilliSeconds());
        clonedOptions.setUseSeparateListener(options.isUseSeparateListener());

        // copy transport related options
        clonedOptions.setListener(options.getListener());
        clonedOptions.setTransportIn(options.getTransportIn());
        clonedOptions.setTransportInProtocol(options.getTransportInProtocol());
        clonedOptions.setTransportOut(clonedOptions.getTransportOut());



        // copy username and password options
        clonedOptions.setUserName(options.getUserName());
        clonedOptions.setPassword(options.getPassword());

        // cloen the property set of the current options object
        for (Object o : options.getProperties().keySet()) {
            String key = (String) o;
            clonedOptions.setProperty(key, options.getProperty(key));
        }

        return clonedOptions;
    }
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:34,代码来源:ServiceUtils.java

示例8: cloneOptions

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
/**
 * Clones the given {@link org.apache.axis2.client.Options} object. This is not a deep copy
 * because this will be called for each and every message going out from synapse. The parent
 * of the cloning options object is kept as a reference.
 *
 * @param options clonning object
 * @return clonned Options object
 */
public static Options cloneOptions(Options options) {

    // create new options object and set the parent
    Options clonedOptions = new Options(options.getParent());

    // copy general options
    clonedOptions.setCallTransportCleanup(options.isCallTransportCleanup());
    clonedOptions.setExceptionToBeThrownOnSOAPFault(options.isExceptionToBeThrownOnSOAPFault());
    clonedOptions.setManageSession(options.isManageSession());
    clonedOptions.setSoapVersionURI(options.getSoapVersionURI());
    clonedOptions.setTimeOutInMilliSeconds(options.getTimeOutInMilliSeconds());
    clonedOptions.setUseSeparateListener(options.isUseSeparateListener());

    // copy transport related options
    clonedOptions.setListener(options.getListener());
    clonedOptions.setTransportIn(options.getTransportIn());
    clonedOptions.setTransportInProtocol(options.getTransportInProtocol());
    clonedOptions.setTransportOut(clonedOptions.getTransportOut());

    // copy username and password options
    clonedOptions.setUserName(options.getUserName());
    clonedOptions.setPassword(options.getPassword());

    // cloen the property set of the current options object
    for (Object o : options.getProperties().keySet()) {
        String key = (String) o;
        clonedOptions.setProperty(key, options.getProperty(key));
    }

    return clonedOptions;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:40,代码来源:AxisServiceUtils.java

示例9: testEchoXMLCompleteSync

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLCompleteSync() throws Exception {
    AxisService service =
            Utils.createSimpleServiceforClient(serviceName,
                                               Echo.class.getName(),
                                               operationName);

    ConfigurationContext configConetxt = UtilServer.createClientConfigurationContext();

    OMFactory fac = OMAbstractFactory.getOMFactory();

    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement method = fac.createOMElement("echoOMElement", omNs);
    OMElement value = fac.createOMElement("myValue", omNs);
    value.setText("Isaac Asimov, The Foundation Trilogy");
    method.addChild(value);
    Options options = new Options();
    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setUseSeparateListener(true);
    options.setAction(operationName.getLocalPart());

    ServiceClient sender = new ServiceClient(configConetxt, service);
    sender.setOptions(options);

    OMElement result = sender.sendReceive(operationName, method);

    TestingUtils.compareWithCreatedOMElement(result);
    sender.cleanup();

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:EchoRawXMLOnTwoChannelsSyncTest.java

示例10: testEchoXMLCompleteSyncwithTwoTransport

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLCompleteSyncwithTwoTransport() throws Exception {
    AxisService service =
            Utils.createSimpleServiceforClient(serviceName,
                                               Echo.class.getName(),
                                               operationName);

    ConfigurationContext configConetxt = UtilServer.createClientConfigurationContext();

    OMFactory fac = OMAbstractFactory.getOMFactory();

    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement method = fac.createOMElement("echoOMElement", omNs);
    OMElement value = fac.createOMElement("myValue", omNs);
    value.setText("Isaac Asimov, The Foundation Trilogy");
    method.addChild(value);
    Options options = new Options();
    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_LOCAL);
    options.setUseSeparateListener(false);
    options.setAction(operationName.getLocalPart());

    ServiceClient sender = new ServiceClient(configConetxt, service);
    sender.setOptions(options);

    OMElement result = sender.sendReceive(operationName, method);

    TestingUtils.compareWithCreatedOMElement(result);
    sender.cleanup();

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:EchoRawXMLOnTwoChannelsSyncTest.java

示例11: createServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
private ServiceClient createServiceClient() throws AxisFault {
    AxisService service = new AxisService("MultiHopRedirectService1");

    service.setClassLoader(Thread.currentThread().getContextClassLoader());
    service.addParameter(
            new Parameter(Constants.SERVICE_CLASS, MultiHopRedirectService1.class.getName()));

    AxisOperation axisOp = new OutInAxisOperation(new QName("echoRedirect"));

    axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver());
    axisOp.setSoapAction(Constants.AXIS2_NAMESPACE_URI + "/" + "echoRedirect");
    axisOp.setOutputAction(Constants.AXIS2_NAMESPACE_URI + "/" + "echoRedirect");
    service.addOperation(axisOp);
    service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + "echoRedirect", axisOp);

    ConfigurationContext configcontext = UtilServer.createClientConfigurationContext();

    ServiceClient sender;
    Options options = new Options();
    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setUseSeparateListener(true);
    options.setTimeOutInMilliSeconds(5000);
    sender = new ServiceClient(configcontext, service);
    sender.setOptions(options);
    sender.engageModule("addressing");
    return sender;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:MultiHopRedirectServiceTest.java

示例12: testSaveAndRestoreOfMessage

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testSaveAndRestoreOfMessage() throws Exception {
    OMElement payload = createEnvelope();

    Options options = new Options();
    options.setTo(TestConstants.targetEPR);
    options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    options.setAction(
            Constants.AXIS2_NAMESPACE_URI + "/" + TestConstants.operationName.getLocalPart());
    options.setUseSeparateListener(true);
    options.setTimeOutInMilliSeconds(50000);

    ConfigurationContext configurationContext = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"),
                                                      null);

    ServiceClient sender = new ServiceClient(configurationContext, null);
    sender.setOptions(options);
    sender.engageModule("addressing");

    OMElement result = sender.sendReceive(payload);

    OMElement element = (OMElement)result.getFirstOMChild();
    OMText binaryNode = (OMText)element.getFirstOMChild();

    compareWithCreatedOMText(binaryNode);

    DataHandler actualDH = (DataHandler)binaryNode.getDataHandler();
    BufferedImage bi = ImageIO.read(actualDH.getDataSource().getInputStream());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:32,代码来源:MessageSaveAndRestoreWithMTOMTest.java


注:本文中的org.apache.axis2.client.Options.setUseSeparateListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。