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


Java WSDLConstants类代码示例

本文整理汇总了Java中org.apache.axis2.wsdl.WSDLConstants的典型用法代码示例。如果您正苦于以下问题:Java WSDLConstants类的具体用法?Java WSDLConstants怎么用?Java WSDLConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getResponse

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
private SOAPEnvelope getResponse(SOAPEnvelope inEnvelope) throws AxisFault {
    ConfigurationContext confctx = ConfigurationContextFactory.
            createConfigurationContextFromFileSystem(TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"),
                                                     null);
    ServiceClient client = new ServiceClient(confctx, null);
    Options options = new Options();
    client.setOptions(options);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setExceptionToBeThrownOnSOAPFault(false);
    MessageContext msgctx = new MessageContext();
    msgctx.setEnvelope(inEnvelope);
    OperationClient opClient = client.createClient(ServiceClient.ANON_OUT_IN_OP);
    opClient.addMessageContext(msgctx);
    opClient.execute(true);
    return opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:FaultHandlingTest.java

示例2: createResponseMessageContext

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * Creates the {@link MessageContext} for the response to message currently being processed.
 *
 * @param reqContext The MessageContext of the received message
 * @return The MessageContext for the response message
 */
public static MessageContext createResponseMessageContext(final MessageContext reqContext) {

    try {
        MessageContext resCtx = null;

        // First try to get the context for the response from the OperationContext
        final OperationContext opContext = reqContext.getOperationContext();
        if (opContext != null) {
            resCtx = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
        }

        // If that fails, construct a new context
        if (resCtx == null) {
            resCtx = MessageContextBuilder.createOutMessageContext(reqContext);
            resCtx.getOperationContext().addMessageContext(resCtx);
        }

        return resCtx;
    } catch (final AxisFault af) {
        // Somewhere the construction of the new MessageContext failed
        return null;
    }
}
 
开发者ID:holodeck-b2b,项目名称:Holodeck-B2B,代码行数:30,代码来源:Axis2Utils.java

示例3: createSpringService

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
private AxisService createSpringService(QName springServiceName,
                                        MessageReceiver messageReceiver, String supplierName,
                                        String beanName, QName opName) throws AxisFault {

    AxisService service = new AxisService(springServiceName.getLocalPart());

    service.setClassLoader(Thread.currentThread().getContextClassLoader());
    service.addParameter(new Parameter(Constants.SERVICE_OBJECT_SUPPLIER, supplierName));
    service.addParameter(new Parameter(Constants.SERVICE_TCCL, Constants.TCCL_COMPOSITE));
    service.addParameter(new Parameter(
            SpringAppContextAwareObjectSupplier.SERVICE_SPRING_BEANNAME, beanName));

    AxisOperation axisOp = new InOutAxisOperation(opName);

    axisOp.setMessageReceiver(messageReceiver);
    axisOp.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp);
    service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(),
                                 axisOp);

    return service;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:SpringServiceTest.java

示例4: createSpringServiceforClient

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
public AxisService createSpringServiceforClient(QName springServiceName,
                                                MessageReceiver messageReceiver,
                                                String supplierName,
                                                String beanName,
                                                QName opName)
        throws AxisFault {
    AxisService service = new AxisService(springServiceName.getLocalPart());

    service.setClassLoader(Thread.currentThread().getContextClassLoader());
    service.addParameter(new Parameter(Constants.SERVICE_OBJECT_SUPPLIER, supplierName));
    service.addParameter(new Parameter(Constants.SERVICE_TCCL, Constants.TCCL_COMPOSITE));
    service.addParameter(new Parameter(
            SpringAppContextAwareObjectSupplier.SERVICE_SPRING_BEANNAME, beanName));

    AxisOperation axisOp = new OutInAxisOperation(opName);

    axisOp.setMessageReceiver(messageReceiver);
    axisOp.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp);

    return service;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:SpringServiceTest.java

示例5: testScenarioThree

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * 1. AddRequest is of AddRequestType 2. AddRequestType extends from AbstractParameterType 3.
 * AbstractParameterType has primitive types only
 */
public void testScenarioThree() {
    String schemaLocation = "test-resources/schemas/schema-3.xsd";

    createAndWalkSchema(schemaLocation);

    assertTrue(axisMessage.getParameter(Constants.UNWRAPPED_KEY).getValue() == Boolean.TRUE);

    Parameter parameter = axisMessage.getParameter(Constants.UNWRAPPED_DETAILS);
    MessagePartInformationHolder messagePartInformationHolder =
            (MessagePartInformationHolder)parameter.getValue();
    List partsList = messagePartInformationHolder.getPartsList();

    assertTrue(partsList.contains(WSDLUtil.getPartQName(ADD_OPERATION,
                                                        WSDLConstants.INPUT_PART_QNAME_SUFFIX,
                                                        PARAMETER_ONE)));
    assertTrue(partsList.contains(WSDLUtil.getPartQName(ADD_OPERATION,
                                                        WSDLConstants.INPUT_PART_QNAME_SUFFIX,
                                                        PARAMETER_TWO)));
    assertTrue(partsList.size() == 2);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:SchemaUnwrapperExtensionTest.java

示例6: createRedirectReceiverService

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
AxisService createRedirectReceiverService() throws AxisFault {
    AxisService service = new AxisService("RedirectReceiverService");

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

    AxisOperation axisOp = new InOnlyAxisOperation(new QName("echoOMElementResponse"));

    axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
    axisOp.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp);
    service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + "echoOMElementResponse",
                                 axisOp);

    AxisOperation axisOp2 = new InOnlyAxisOperation(new QName("fault"));

    axisOp2.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
    axisOp2.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp2);
    service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + "fault", axisOp2);

    return service;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:AddressingSubmissionServiceTest.java

示例7: createSimpleOneWayServiceforClient

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
public static AxisService createSimpleOneWayServiceforClient(QName serviceName,
                                                             String className,
                                                             QName opName)
        throws AxisFault {
    AxisService service = new AxisService(serviceName.getLocalPart());

    service.setClassLoader(Thread.currentThread().getContextClassLoader());
    service.addParameter(new Parameter(Constants.SERVICE_CLASS, className));

    AxisOperation axisOp = new OutOnlyAxisOperation(opName);

    axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
    axisOp.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp);

    return service;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:18,代码来源:AddressingSubmissionServiceTest.java

示例8: echoOM

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
public OMElement echoOM(OMElement omEle) throws AxisFault {
    MessageContext outMsgCtx = MessageContext.getCurrentMessageContext().getOperationContext().getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    Object object = outMsgCtx.getProperty(Constants.Configuration.MESSAGE_TYPE);
    String messageType = (String) object;

    //if the request is through GET, the message type is application/xml. otherwise don't allow
    //any non json specific message types
    if (messageType.equalsIgnoreCase(HTTPConstants.MEDIA_TYPE_APPLICATION_XML)) {
        outMsgCtx.setProperty(Constants.Configuration.MESSAGE_TYPE, "application/json");
    } else if (messageType.indexOf("json") < 0) {
        throw new AxisFault("Type of the Received Message is not JSON");
    }
    OMDataSource omdataOSuce = ((OMSourcedElement) omEle).getDataSource();
    OMElement newOmEle = (OMElement) omEle.detach();
    ((OMSourcedElement) newOmEle).setDataSource(omdataOSuce);
    return omEle;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:18,代码来源:Echo.java

示例9: addCSpecifcAttributes

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * @param doc
 * @param operation
 * @param param
 */
protected void addCSpecifcAttributes(Document doc, AxisOperation operation, Element param,
                                     String messageType) {
    String typeMappingStr;
    AxisMessage message;

    if (messageType.equals(WSDLConstants.MESSAGE_LABEL_IN_VALUE)) {
        message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    } else {
        message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    }

    String paramType = this.mapper.getTypeMappingName(message.getElementQName());
    if (doc == null || paramType == null || param == null) {
        return;
    }

    String type = this.mapper.getTypeMappingName(message.getElementQName());
    typeMappingStr = (type == null) ? "" : type;
    addAttribute(doc, "caps-type", paramType.toUpperCase(), param);

    if (!paramType.equals("") && !paramType.equals("void") &&
            !typeMappingStr.equals(C_DEFAULT_TYPE) && typeMappingStr.contains("adb_")) {
        addAttribute(doc, "ours", "yes", param);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:CEmitter.java

示例10: getRelatedMessageContext

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * getRelatedMessageContext
 * @param mc Axis2 MessageContext
 * @return related MessageContext
 */
private static org.apache.axis2.context.MessageContext 
    getRelatedMessageContext(org.apache.axis2.context.MessageContext mc) {
    if (log.isDebugEnabled()) {
        log.debug("Enter getRelatedMessageContext for:" + mc);
    }
    org.apache.axis2.context.MessageContext relatedMC = null;
    if (mc != null) {
        OperationContext oc = mc.getOperationContext();
        if (oc != null) {
            try {
                relatedMC = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                if (relatedMC == mc) {
                    relatedMC = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                }
            } catch (AxisFault e) {
                // TODO This should never occur in this scenario, swallow and continue
            }
        }
    }
    if (log.isDebugEnabled()) {
        log.debug("Exit getRelatedMessageContext related messageContext is" + relatedMC);
    }
    return relatedMC;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:30,代码来源:ContextUtils.java

示例11: getRelatedMessageContext

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * @param mc
 * @return
 */
private static MessageContext getRelatedMessageContext(MessageContext mc) {
    if (log.isDebugEnabled()) {
        log.debug("Enter getRelatedMessageContext for:" + mc);
    }
    MessageContext relatedMC = null;
    if (mc != null) {
        OperationContext oc = mc.getOperationContext();
        if (oc != null) {
            try {
                relatedMC = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                if (relatedMC == mc) {
                    relatedMC = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                }
            } catch (AxisFault e) {
                // TODO This should never occur in this scenario, swallow and continue
            }
        }
    }
    if (log.isDebugEnabled()) {
        log.debug("Exit getRelatedMessageContext related messageContext is" + relatedMC);
    }
    return relatedMC;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:HandlerUtils.java

示例12: invoke

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * @param msgctx
 * @throws org.apache.axis2.AxisFault
 */
public InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
    if ((msgctx.getAxisService() != null) && (msgctx.getAxisOperation() == null)) {
        AxisOperation axisOperation = findOperation(msgctx.getAxisService(), msgctx);

        if (axisOperation != null) {
            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("operationfound",
                                                                              axisOperation
                                                                                      .getName().getLocalPart()));
            }

            msgctx.setAxisOperation(axisOperation);
            //setting axisMessage into messageContext
            msgctx.setAxisMessage(axisOperation.getMessage(
                    WSDLConstants.MESSAGE_LABEL_IN_VALUE));
        }
    }
    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:AbstractOperationDispatcher.java

示例13: getUnderstoodClientHeaders

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * Get the collection of Header QNames that are registered as being understood.
 * This assumes that a Set of QNames which indicates what headers are "understood" by
 * this particular client through the client's programming model (i.e. application
 * handlers) has been defined and stored on the outbound MessageContext under the
 * client.UnderstoodHeaders property. 
 * @param msgContext The inbound message context
 * @return a Set of Header QNames that have been registered as understood, or null if
 * none have been registered.
 */
private static Set getUnderstoodClientHeaders(MessageContext msgContext) {
    Set returnQN = null;
    // The client sets the property on the JAX-WS Request Message Context, which will be copied
    // to the Axis2 outbound message context.
    OperationContext opCtx = msgContext.getOperationContext();
    MessageContext outboundMC = null;
    try {
        outboundMC = opCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    }
    catch (AxisFault af) {
        // Ignore this; it means that there wasn't an outbound message for this operation.
    }
    if (outboundMC != null) {
        returnQN =
                (Set) outboundMC.getProperty("client.UnderstoodHeaders");
    }
    return returnQN;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:AxisEngine.java

示例14: createOperationContext

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
public static OperationContext createOperationContext(int mepURI, AxisOperation axisOp,
                                                      ServiceContext serviceContext)
        throws AxisFault {
    if ((WSDLConstants.MEP_CONSTANT_IN_OUT == mepURI) ||
            (WSDLConstants.MEP_CONSTANT_IN_ONLY == mepURI)
            || (WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT == mepURI)
            || (WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY == mepURI) ||
            (WSDLConstants.MEP_CONSTANT_OUT_ONLY == mepURI)
            || (WSDLConstants.MEP_CONSTANT_OUT_IN == mepURI) ||
            (WSDLConstants.MEP_CONSTANT_OUT_OPTIONAL_IN == mepURI)
            || (WSDLConstants.MEP_CONSTANT_ROBUST_OUT_ONLY == mepURI)) {
        return serviceContext.createOperationContext(axisOp);
    } else {
        throw new AxisFault(Messages.getMessage("unSupportedMEP", "ID is " + mepURI));
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:OperationContextFactory.java

示例15: sendReceive

import org.apache.axis2.wsdl.WSDLConstants; //导入依赖的package包/类
/**
 * Directly invoke a named operationQName with an In-Out MEP. This method sends your supplied
 * XML and receives a response. For more control, you can instead create a client for the
 * operationQName and use that client to execute the exchange.
 * <p>
 * Unless the <code>callTransportCleanup</code> property on the {@link Options} object has been
 * set to <code>true</code>, the caller must invoke {@link #cleanupTransport()} after
 * processing the response.
 *
 * @param operationQName name of operationQName to be invoked (non-<code>null</code>)
 * @param xmlPayload     the data to send (becomes the content of SOAP body)
 * @return response OMElement
 * @throws AxisFault in case of error
 * @see #cleanupTransport()
 */
public OMElement sendReceive(QName operationQName, OMElement xmlPayload)
        throws AxisFault {
    MessageContext messageContext = new MessageContext();
    fillSOAPEnvelope(messageContext, xmlPayload);
    OperationClient operationClient = createClient(operationQName);
    operationClient.addMessageContext(messageContext);
    operationClient.execute(true);
    MessageContext response = operationClient
            .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    if (options.isCallTransportCleanup()) {
        response.getEnvelope().buildWithAttachments();
        cleanupTransport();
    }
    return response.getEnvelope().getBody().getFirstElement();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:ServiceClient.java


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