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


Java AxisOperation.setWsamappingList方法代码示例

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


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

示例1: testFindOperation

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void testFindOperation() throws Exception {
    MessageContext messageContext = new MessageContext();
    AxisService as = new AxisService("Service1");
    messageContext.setAxisService(as);

    AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
    ArrayList op1actions = new ArrayList();
    op1actions.add("urn:org.apache.axis2.dispatchers.test:operation1");
    operation1.setWsamappingList(op1actions);

    AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
    ArrayList op2actions = new ArrayList();
    op2actions.add("urn:org.apache.axis2.dispatchers.test:operation2");
    operation2.setWsamappingList(op2actions);

    as.addOperation(operation1);
    as.addOperation(operation2);

    as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation1", operation1);
    as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation2", operation2);

    messageContext.setWSAAction("urn:org.apache.axis2.dispatchers.test:operation2");

    ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
    abod.invoke(messageContext);
    assertEquals(operation2, messageContext.getAxisOperation());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:ActionBasedOperationDispatchTest.java

示例2: processActionMappings

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Populate the AxisOperation with details from the actionMapping,
 * outputActionMapping and faultActionMapping elements from the operation
 * element.
 *
 * @param operation
 * @param op_descrip
 */
protected void processActionMappings(OMElement operation,
                                     AxisOperation op_descrip) {
    Iterator mappingIterator = operation.getChildrenWithName(new QName(
            Constants.ACTION_MAPPING));
    ArrayList mappingList = new ArrayList();
    while (mappingIterator.hasNext()) {
        OMElement mappingElement = (OMElement) mappingIterator.next();
        String inputActionString = mappingElement.getText().trim();
        if (log.isTraceEnabled()) {
            log.trace("Input Action Mapping found: " + inputActionString);
        }
        if (!"".equals(inputActionString)) {
            mappingList.add(inputActionString);
        } else {
            if (log.isTraceEnabled()) {
                log.trace("Zero length input action string found. Not added to mapping");
            }
        }
    }
    op_descrip.setWsamappingList(mappingList);

    OMElement outputAction = operation.getFirstChildWithName(new QName(
            Constants.OUTPUT_ACTION_MAPPING));
    if ((outputAction != null) && (outputAction.getText() != null)) {
        String outputActionString = outputAction.getText().trim();
        if (log.isTraceEnabled()) {
            log.trace("Output Action Mapping found: " + outputActionString);
        }
        op_descrip.setOutputAction(outputActionString);
    }
    Iterator faultActionsIterator = operation
            .getChildrenWithName(new QName(Constants.FAULT_ACTION_MAPPING));
    while (faultActionsIterator.hasNext()) {
        OMElement faultMappingElement = (OMElement) faultActionsIterator
                .next();
        String faultActionString = faultMappingElement.getText().trim();
        String faultActionName = faultMappingElement
                .getAttributeValue(new QName(Constants.FAULT_ACTION_NAME));
        if (faultActionName != null && faultActionString != null) {
            if (log.isTraceEnabled()) {
                log.trace("Fault Action Mapping found: " + faultActionName
                        + ", " + faultActionString);
            }
            op_descrip.addFaultAction(faultActionName, faultActionString);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:56,代码来源:DescriptionBuilder.java


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