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


Java EndpointReference.hasNoneAddress方法代码示例

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


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

示例1: invoke

import org.apache.axis2.addressing.EndpointReference; //导入方法依赖的package包/类
/**
 * Method invoke
 *
 * @param msgContext the current MessageContext
 * @throws AxisFault
 */
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {

    // Check for the REST behaviour, if you desire rest beahaviour
    // put a <parameter name="doREST" value="true"/> at the axis2.xml
    msgContext.setDoingMTOM(TransportUtils.doWriteMTOM(msgContext));
    msgContext.setDoingSwA(TransportUtils.doWriteSwA(msgContext));

    OutputStream out;
    EndpointReference epr = msgContext.getTo();

    if (log.isDebugEnabled()) {
        log.debug("Sending - " + msgContext.getEnvelope().toString());
    }

    if (epr != null) {
        if (!epr.hasNoneAddress()) {
            out = new ByteArrayOutputStream();
            TransportUtils.writeMessage(msgContext, out);
            finalizeSendWithToAddress(msgContext, (ByteArrayOutputStream)out);
        }
    } else {
        out = (OutputStream) msgContext.getProperty(MessageContext.TRANSPORT_OUT);

        if (out != null) {
            TransportUtils.writeMessage(msgContext, out);
        } else {
            throw new AxisFault(
                    "Both the TO and Property MessageContext.TRANSPORT_OUT is Null, No where to send");
        }
    }

    TransportUtils.setResponseWritten(msgContext, true);
    
    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:42,代码来源:LocalTransportSender.java

示例2: setupCorrectTransportOut

import org.apache.axis2.addressing.EndpointReference; //导入方法依赖的package包/类
/**
 * Ensure that if the scheme of the To EPR for the response is different than the
 * transport used for the request that the correct TransportOut is available
 */
private static void setupCorrectTransportOut(MessageContext context) throws AxisFault {
    // Determine that we have the correct transport available.
    TransportOutDescription transportOut = context.getTransportOut();

    try {
        EndpointReference responseEPR = context.getTo();
        if (context.isServerSide() && responseEPR != null) {
            if (!responseEPR.hasAnonymousAddress() && !responseEPR.hasNoneAddress()) {
                URI uri = new URI(responseEPR.getAddress());
                String scheme = uri.getScheme();
                if ((transportOut == null) || !transportOut.getName().equals(scheme)) {
                    ConfigurationContext configurationContext =
                            context.getConfigurationContext();
                    transportOut = configurationContext.getAxisConfiguration()
                            .getTransportOut(scheme);
                    if (transportOut == null) {
                        throw new AxisFault("Can not find the transport sender : " + scheme);
                    }
                    context.setTransportOut(transportOut);
                }
                if (context.getOperationContext() != null) {
                    context.getOperationContext().setProperty(
                            Constants.DIFFERENT_EPR, Constants.VALUE_TRUE);
                }
            }
        }
    } catch (URISyntaxException urise) {
        throw AxisFault.makeFault(urise);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:35,代码来源:MessageContextBuilder.java

示例3: invoke

import org.apache.axis2.addressing.EndpointReference; //导入方法依赖的package包/类
/**
 * Method invoke
 *
 * @param msgContext the active MessageContext
 * @throws AxisFault
 */
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {

    // Check for the REST behaviour, if you desire rest beahaviour
    // put a <parameter name="doREST" value="true"/> at the axis2.xml
    msgContext.setDoingMTOM(TransportUtils.doWriteMTOM(msgContext));
    msgContext.setDoingSwA(TransportUtils.doWriteSwA(msgContext));

    EndpointReference epr = null;

    if (msgContext.getTo() != null && !msgContext.getTo().hasAnonymousAddress()) {
        epr = msgContext.getTo();
    }

    try {
        if (log.isDebugEnabled()) {
            log.debug("Response - " + msgContext.getEnvelope().toString());
        }

        if (epr != null) {
            if (!epr.hasNoneAddress()) {
                TransportUtils.writeMessage(msgContext, out);
            }
        } else {
            if (/*(msgContext != null) &&*/ (msgContext.getOperationContext() != null) &&
                    (msgContext.getOperationContext().getMessageContexts() != null)) {
                MessageContext proxyInMessageContext = msgContext.
                        getOperationContext().getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN);

                if (proxyInMessageContext != null) {
                    MessageContext initialMessageContext = (MessageContext) proxyInMessageContext.
                            getProperty(LocalTransportReceiver.IN_MESSAGE_CONTEXT);

                    if (initialMessageContext != null) {
                        handleResponse(msgContext, initialMessageContext);
                    } else {
                        out = (OutputStream) msgContext.getProperty(MessageContext.TRANSPORT_OUT);

                        if (out != null) {
                            TransportUtils.writeMessage(msgContext, out);
                        } else {
                            throw new AxisFault(
                                    "Both the TO and Property MessageContext.TRANSPORT_OUT is Null, No where to send");
                        }

                    }
                }
            } else {
                out = (OutputStream) msgContext.getProperty(MessageContext.TRANSPORT_OUT);

                if (out != null) {
                    TransportUtils.writeMessage(msgContext, out);
                } else {
                    throw new AxisFault(
                            "Both the TO and Property MessageContext.TRANSPORT_OUT is Null, No where to send");
                }
            }
        }
    } catch (AxisFault axisFault) {
        // At this point all we can do is log this error, since it happened while
        // we were sending the response!
        log.error("Error sending response", axisFault);
    }

    TransportUtils.setResponseWritten(msgContext, true);

    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:74,代码来源:LocalResponder.java


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