• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Messages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.ws.api.message.Messages的典型用法代码示例。如果您正苦于以下问题:Java Messages类的具体用法?Java Messages怎么用?Java Messages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Messages类属于com.sun.xml.internal.ws.api.message包,在下文中一共展示了Messages类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: insertFaultMessage

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
/**
 * Replace the message in the given message context with a
 * fault message. If the context already contains a fault
 * message, then return without changing it.
 *
 * <p>This method should only be called during a request,
 * because during a response an exception from a handler
 * is dispatched rather than replacing the message with
 * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
 * to determine whether it is being called on the client
 * or the server side. If this changes in the spec, then
 * something else will need to be passed to the method
 * to determine whether the fault code is client or server.
 */
final void insertFaultMessage(C context,
    ProtocolException exception) {
    try {
        if(!context.getPacketMessage().isFault()) {
            Message faultMessage = Messages.create(binding.getSOAPVersion(),
                    exception,determineFaultCode(binding.getSOAPVersion()));
            context.setPacketMessage(faultMessage);
        }
    } catch (Exception e) {
        // severe since this is from runtime and not handler
        logger.log(Level.SEVERE,
            "exception while creating fault message in handler chain", e);
        throw new RuntimeException(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:SOAPHandlerProcessor.java


示例2: insertFaultMessage

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
final void insertFaultMessage(C context,
        ProtocolException exception) {
    if(exception instanceof HTTPException) {
        context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
    }
    if (context != null) {
        // non-soap case
        context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XMLHandlerProcessor.java


示例3: decode

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:FastInfosetCodec.java


示例4: getWSDLOperationMapping

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    MessageHeaders hl = request.getMessage().getHeaders();
    String action = AddressingUtils.getAction(hl, av, binding.getSOAPVersion());

    if (action == null)
        // Addressing is not enagaged, return null to use other ways to dispatch.
        return null;

    Message message = request.getMessage();
    QName payloadName;
    String localPart = message.getPayloadLocalPart();
    if (localPart == null) {
        payloadName = EMPTY_PAYLOAD;
    } else {
        String nsUri = message.getPayloadNamespaceURI();
        if (nsUri == null)
            nsUri = EMPTY_PAYLOAD_NSURI;
        payloadName = new QName(nsUri, localPart);
    }

    WSDLOperationMapping opMapping = uniqueOpSignatureMap.get(new ActionBasedOperationSignature(action, payloadName));
    if (opMapping != null)
        return opMapping;

    //Seems like in Wstrust STS wsdls, the payload does not match what is specified in the wsdl leading to incorrect
    //  wsdl operation resolution. Use just wsa:Action to dispatch as a last resort.
    //try just with wsa:Action
    opMapping = actionMap.get(action);
    if (opMapping != null)
        return opMapping;

    // invalid action header
    Message result = Messages.create(action, av, binding.getSOAPVersion());

    throw new DispatchException(result);

}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:38,代码来源:ActionBasedOperationFinder.java


示例5: decode

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message = null;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:15,代码来源:FastInfosetCodec.java


示例6: getWSDLOperationQName

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
/**
 *
 * @param request  Request Packet that is used to find the associated WSDLOperation
 * @return WSDL operation Qname.
 *         return null if WS-Addressing is not engaged.
 * @throws DispatchException with WSA defined fault message when it cannot find an associated WSDL operation.
 *
 */
@Override
public QName getWSDLOperationQName(Packet request) throws DispatchException {
    HeaderList hl = request.getMessage().getHeaders();
    String action = hl.getAction(av, binding.getSOAPVersion());

    if (action == null)
        // Addressing is not enagaged, return null to use other ways to dispatch.
        return null;

    Message message = request.getMessage();
    QName payloadName;
    String localPart = message.getPayloadLocalPart();
    if (localPart == null) {
        payloadName = EMPTY_PAYLOAD;
    } else {
        String nsUri = message.getPayloadNamespaceURI();
        if (nsUri == null)
            nsUri = EMPTY_PAYLOAD_NSURI;
        payloadName = new QName(nsUri, localPart);
    }

    QName opName = uniqueOpSignatureMap.get(new ActionBasedOperationSignature(action, payloadName));
    if (opName != null)
        return opName;

    //Seems like in Wstrust STS wsdls, the payload does not match what is specified in the wsdl leading to incorrect
    //  wsdl operation resolution. Use just wsa:Action to dispatch as a last resort.
    //try just with wsa:Action
    opName = actionMap.get(action);
    if (opName != null)
        return opName;

    // invalid action header
    Message result = Messages.create(action, av, binding.getSOAPVersion());

    throw new DispatchException(result);

}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:47,代码来源:ActionBasedOperationFinder.java


示例7: createMessage

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
Message createMessage(Object[] methodArgs) {
    return Messages.createEmpty(soapVersion);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:BodyBuilder.java


示例8: createMessage

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
public Message createMessage(Object[] methodArgs, Object returnValue) {
    return Messages.createEmpty(soapVersion);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:EndpointResponseMessageBuilder.java


示例9: getResponseMessage

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
public Message getResponseMessage(Source source) {
    return Messages.createUsingPayload(source, SOAPVersion.SOAP_11);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:XMLProviderArgumentBuilder.java


示例10: getResponseMessage

import com.sun.xml.internal.ws.api.message.Messages; //导入依赖的package包/类
protected Message getResponseMessage(Source source) {
    return Messages.createUsingPayload(source, soapVersion);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:SOAPProviderArgumentBuilder.java



注:本文中的com.sun.xml.internal.ws.api.message.Messages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ThreadPool类代码示例发布时间:2022-05-23
下一篇:
Java StoppableFunction类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap