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


Java JAXBMessage.create方法代码示例

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


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

示例1: createSOAPFaultMessage

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
public static Message createSOAPFaultMessage(SOAPVersion soapVersion, SOAPFault fault) {
    switch (soapVersion) {
        case SOAP_11:
            return JAXBMessage.create(JAXB_CONTEXT, new SOAP11Fault(fault), soapVersion);
        case SOAP_12:
            return JAXBMessage.create(JAXB_CONTEXT, new SOAP12Fault(fault), soapVersion);
        default:
            throw new AssertionError();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SOAPFaultBuilder.java

示例2: getMessage

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    return JAXBMessage.create(BindingContextFactory.create(ctxt), o,binding.getSOAPVersion(), headers,attachments);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:LogicalMessageImpl.java

示例3: createMessage

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

示例4: createMessage

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

示例5: createSOAP11Fault

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
private static Message createSOAP11Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
    SOAPFaultException soapFaultException = null;
    String faultString = null;
    String faultActor = null;
    Throwable cause = e.getCause();
    if (e instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e;
    } else if (cause != null && cause instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e.getCause();
    }
    if (soapFaultException != null) {
        QName soapFaultCode = soapFaultException.getFault().getFaultCodeAsQName();
        if(soapFaultCode != null)
            faultCode = soapFaultCode;

        faultString = soapFaultException.getFault().getFaultString();
        faultActor = soapFaultException.getFault().getFaultActor();
    }

    if (faultCode == null) {
        faultCode = getDefaultFaultCode(soapVersion);
    }

    if (faultString == null) {
        faultString = e.getMessage();
        if (faultString == null) {
            faultString = e.toString();
        }
    }
    Element detailNode = null;
    QName firstEntry = null;
    if (detail == null && soapFaultException != null) {
        detailNode = soapFaultException.getFault().getDetail();
        firstEntry = getFirstDetailEntryName((Detail)detailNode);
    } else if(ce != null){
        try {
            DOMResult dr = new DOMResult();
            ce.getBond().marshal(detail,dr);
            detailNode = (Element)dr.getNode().getFirstChild();
            firstEntry = getFirstDetailEntryName(detailNode);
        } catch (JAXBException e1) {
            //Should we throw Internal Server Error???
            faultString = e.getMessage();
            faultCode = getDefaultFaultCode(soapVersion);
        }
    }
    SOAP11Fault soap11Fault = new SOAP11Fault(faultCode, faultString, faultActor, detailNode);

    //Don't fill the stacktrace for Service specific exceptions.
    if(ce == null) {
        soap11Fault.captureStackTrace(e);
    }
    Message msg = JAXBMessage.create(JAXB_CONTEXT, soap11Fault, soapVersion);
    return new FaultMessage(msg, firstEntry);
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:56,代码来源:SOAPFaultBuilder.java

示例6: createSOAP12Fault

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
private static Message createSOAP12Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
    SOAPFaultException soapFaultException = null;
    CodeType code = null;
    String faultString = null;
    String faultRole = null;
    String faultNode = null;
    Throwable cause = e.getCause();
    if (e instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e;
    } else if (cause != null && cause instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e.getCause();
    }
    if (soapFaultException != null) {
        SOAPFault fault = soapFaultException.getFault();
        QName soapFaultCode = fault.getFaultCodeAsQName();
        if(soapFaultCode != null){
            faultCode = soapFaultCode;
            code = new CodeType(faultCode);
            Iterator iter = fault.getFaultSubcodes();
            boolean first = true;
            SubcodeType subcode = null;
            while(iter.hasNext()){
                QName value = (QName)iter.next();
                if(first){
                    SubcodeType sct = new SubcodeType(value);
                    code.setSubcode(sct);
                    subcode = sct;
                    first = false;
                    continue;
                }
                subcode = fillSubcodes(subcode, value);
            }
        }
        faultString = soapFaultException.getFault().getFaultString();
        faultRole = soapFaultException.getFault().getFaultActor();
        faultNode = soapFaultException.getFault().getFaultNode();
    }

    if (faultCode == null) {
        faultCode = getDefaultFaultCode(soapVersion);
        code = new CodeType(faultCode);
    }else if(code == null){
        code = new CodeType(faultCode);
    }

    if (faultString == null) {
        faultString = e.getMessage();
        if (faultString == null) {
            faultString = e.toString();
        }
    }

    ReasonType reason = new ReasonType(faultString);
    Element detailNode = null;
    QName firstEntry = null;
    if (detail == null && soapFaultException != null) {
        detailNode = soapFaultException.getFault().getDetail();
        firstEntry = getFirstDetailEntryName((Detail)detailNode);
    } else if(detail != null){
        try {
            DOMResult dr = new DOMResult();
            ce.getBond().marshal(detail, dr);
            detailNode = (Element)dr.getNode().getFirstChild();
            firstEntry = getFirstDetailEntryName(detailNode);
        } catch (JAXBException e1) {
            //Should we throw Internal Server Error???
            faultString = e.getMessage();
        }
    }

    SOAP12Fault soap12Fault = new SOAP12Fault(code, reason, faultNode, faultRole, detailNode);

    //Don't fill the stacktrace for Service specific exceptions.
    if(ce == null) {
        soap12Fault.captureStackTrace(e);
    }
    Message msg = JAXBMessage.create(JAXB_CONTEXT, soap12Fault, soapVersion);
    return new FaultMessage(msg, firstEntry);
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:80,代码来源:SOAPFaultBuilder.java

示例7: getMessage

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) {
    return JAXBMessage.create((JAXBRIContext)ctxt, o,binding.getSOAPVersion(), headers,attachments);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:4,代码来源:LogicalMessageImpl.java

示例8: createMessage

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
final Message createMessage(Object[] methodArgs, Object returnValue) {
    return JAXBMessage.create( bridge, build(methodArgs, returnValue), soapVersion );
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:4,代码来源:EndpointResponseMessageBuilder.java

示例9: createSOAP11Fault

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
private static Message createSOAP11Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
    SOAPFaultException soapFaultException = null;
    String faultString = null;
    String faultActor = null;
    Throwable cause = e.getCause();
    if (e instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e;
    } else if (cause != null && cause instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e.getCause();
    }
    if (soapFaultException != null) {
        QName soapFaultCode = soapFaultException.getFault().getFaultCodeAsQName();
        if(soapFaultCode != null)
            faultCode = soapFaultCode;

        faultString = soapFaultException.getFault().getFaultString();
        faultActor = soapFaultException.getFault().getFaultActor();
    }

    if (faultCode == null) {
        faultCode = getDefaultFaultCode(soapVersion);
    }

    if (faultString == null) {
        faultString = e.getMessage();
        if (faultString == null) {
            faultString = e.toString();
        }
    }
    Element detailNode = null;
    QName firstEntry = null;
    if (detail == null && soapFaultException != null) {
        detailNode = soapFaultException.getFault().getDetail();
        firstEntry = getFirstDetailEntryName((Detail)detailNode);
    } else if(ce != null){
        try {
            DOMResult dr = new DOMResult();
            ce.getBridge().marshal(detail,dr);
            detailNode = (Element)dr.getNode().getFirstChild();
            firstEntry = getFirstDetailEntryName(detailNode);
        } catch (JAXBException e1) {
            //Should we throw Internal Server Error???
            faultString = e.getMessage();
            faultCode = getDefaultFaultCode(soapVersion);
        }
    }
    SOAP11Fault soap11Fault = new SOAP11Fault(faultCode, faultString, faultActor, detailNode);

    //Don't fill the stacktrace for Service specific exceptions.
    if(ce == null) {
        soap11Fault.captureStackTrace(e);
    }
    Message msg = JAXBMessage.create(JAXB_CONTEXT, soap11Fault, soapVersion);
    return new FaultMessage(msg, firstEntry);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:56,代码来源:SOAPFaultBuilder.java

示例10: createSOAP12Fault

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
private static Message createSOAP12Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
    SOAPFaultException soapFaultException = null;
    CodeType code = null;
    String faultString = null;
    String faultRole = null;
    String faultNode = null;
    Throwable cause = e.getCause();
    if (e instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e;
    } else if (cause != null && cause instanceof SOAPFaultException) {
        soapFaultException = (SOAPFaultException) e.getCause();
    }
    if (soapFaultException != null) {
        SOAPFault fault = soapFaultException.getFault();
        QName soapFaultCode = fault.getFaultCodeAsQName();
        if(soapFaultCode != null){
            faultCode = soapFaultCode;
            code = new CodeType(faultCode);
            Iterator iter = fault.getFaultSubcodes();
            boolean first = true;
            SubcodeType subcode = null;
            while(iter.hasNext()){
                QName value = (QName)iter.next();
                if(first){
                    SubcodeType sct = new SubcodeType(value);
                    code.setSubcode(sct);
                    subcode = sct;
                    first = false;
                    continue;
                }
                subcode = fillSubcodes(subcode, value);
            }
        }
        faultString = soapFaultException.getFault().getFaultString();
        faultRole = soapFaultException.getFault().getFaultActor();
        faultNode = soapFaultException.getFault().getFaultNode();
    }

    if (faultCode == null) {
        faultCode = getDefaultFaultCode(soapVersion);
        code = new CodeType(faultCode);
    }else if(code == null){
        code = new CodeType(faultCode);
    }

    if (faultString == null) {
        faultString = e.getMessage();
        if (faultString == null) {
            faultString = e.toString();
        }
    }

    ReasonType reason = new ReasonType(faultString);
    Element detailNode = null;
    QName firstEntry = null;
    if (detail == null && soapFaultException != null) {
        detailNode = soapFaultException.getFault().getDetail();
        firstEntry = getFirstDetailEntryName((Detail)detailNode);
    } else if(detail != null){
        try {
            DOMResult dr = new DOMResult();
            ce.getBridge().marshal(detail, dr);
            detailNode = (Element)dr.getNode().getFirstChild();
            firstEntry = getFirstDetailEntryName(detailNode);
        } catch (JAXBException e1) {
            //Should we throw Internal Server Error???
            faultString = e.getMessage();
            faultCode = getDefaultFaultCode(soapVersion);
        }
    }

    SOAP12Fault soap12Fault = new SOAP12Fault(code, reason, faultNode, faultRole, detailNode);

    //Don't fill the stacktrace for Service specific exceptions.
    if(ce == null) {
        soap12Fault.captureStackTrace(e);
    }
    Message msg = JAXBMessage.create(JAXB_CONTEXT, soap12Fault, soapVersion);
    return new FaultMessage(msg, firstEntry);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:81,代码来源:SOAPFaultBuilder.java

示例11: create

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
/**
 * Creates a {@link Message} backed by a JAXB bean.
 * @deprecated
 * @param context
 *      The context to be used to produce infoset from the object. Must not be null.
 * @param jaxbObject
 *      The JAXB object that represents the payload. must not be null. This object
 *      must be bound to an element (which means it either is a {@link JAXBElement} or
 *      an instanceof a class with {@link XmlRootElement}).
 * @param soapVersion
 *      The SOAP version of the message. Must not be null.
 */
public static Message create(JAXBContext context, Object jaxbObject, SOAPVersion soapVersion) {
    return JAXBMessage.create(context,jaxbObject,soapVersion);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:Messages.java

示例12: create

import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; //导入方法依赖的package包/类
/**
 * Creates a {@link Message} backed by a JAXB bean.
 *
 * @param context
 *      The context to be used to produce infoset from the object. Must not be null.
 * @param jaxbObject
 *      The JAXB object that represents the payload. must not be null. This object
 *      must be bound to an element (which means it either is a {@link JAXBElement} or
 *      an instanceof a class with {@link XmlRootElement}).
 * @param soapVersion
 *      The SOAP version of the message. Must not be null.
 */
public static Message create(JAXBRIContext context, Object jaxbObject, SOAPVersion soapVersion) {
    return JAXBMessage.create(context,jaxbObject,soapVersion);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:16,代码来源:Messages.java


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