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


Java SOAPHeader.getFirstChildWithName方法代码示例

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


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

示例1: handleSoapHeaderPartDef

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
private static void handleSoapHeaderPartDef(org.apache.ode.bpel.iapi.Message odeMessage,
                                            Definition wsdl,
                                            SOAPHeader header,
                                            javax.wsdl.extensions.soap.SOAPHeader headerdef,
                                            Message msgType) throws BPELFault {
    // Is this header part of the "payload" messsage?
    boolean payloadMessageHeader = headerdef.getMessage() == null
            || headerdef.getMessage().equals(msgType.getQName());
    boolean requiredHeader = payloadMessageHeader
            || (headerdef.getRequired() != null && headerdef.getRequired());

    if (requiredHeader && header == null) {
        throw new BPELFault("SOAP Header missing required element.");
    }
    if (header == null) {
        return;
    }

    Message hdrMsg = wsdl.getMessage(headerdef.getMessage());
    if (hdrMsg == null) {
        return;
    }
    Part p = hdrMsg.getPart(headerdef.getPart());
    if (p == null || p.getElementName() == null) {
        return;
    }
    OMElement headerEl = header.getFirstChildWithName(p.getElementName());
    if (requiredHeader && headerEl == null) {
        throw new BPELFault("SOAP Header missing required element: " + p.getElementName());
    }

    if (headerEl == null) {
        return;
    }

    odeMessage.setHeaderPart(p.getName(), OMUtils.toDOM(headerEl));
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:38,代码来源:SOAPUtils.java

示例2: addOverridingHumanTaskAttributes

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
public void addOverridingHumanTaskAttributes(MessageContext msgCtx, boolean isSkipable) {
    SOAPHeader header = msgCtx.getEnvelope().getHeader();
    OMNamespace omNs = soapFactory.createOMNamespace(
            BPEL4PeopleConstants.HT_CONTEXT_NAMESPACE, BPEL4PeopleConstants.HT_CONTEXT_DEFAULT_PREFIX);
    OMElement contextRequest = header.getFirstChildWithName(
            new QName(BPEL4PeopleConstants.HT_CONTEXT_NAMESPACE, BPEL4PeopleConstants.HT_CONTEXT_REQUEST));
    //If context element is not exist create new one.
    if (contextRequest == null) {
        contextRequest = soapFactory.createOMElement(BPEL4PeopleConstants.HT_CONTEXT_REQUEST, omNs);
    }
    OMElement isSkipableElement = soapFactory.createOMElement(BPEL4PeopleConstants.HT_CONTEXT_IS_SKIPABLE, omNs);
    isSkipableElement.setText(Boolean.toString(isSkipable));
    contextRequest.addChild(isSkipableElement);
    header.addChild(contextRequest);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:16,代码来源:SOAPHelper.java

示例3: extractServiceGroupContextId

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
private void extractServiceGroupContextId(MessageContext msgContext) throws AxisFault {
    SOAPHeader soapHeader = msgContext.getEnvelope().getHeader();
    if (soapHeader != null) {
        OMElement serviceGroupId = soapHeader.getFirstChildWithName(SERVICE_GROUP_QNAME);
        if (serviceGroupId != null) {
            msgContext.setServiceGroupContextId(serviceGroupId.getText());
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:10,代码来源:DispatchPhase.java


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