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


Java SOAPHeader.addChild方法代码示例

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


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

示例1: buildSoapEnvelope

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
private SOAPEnvelope buildSoapEnvelope(String clientID, String value) {
    SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();

    SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();

    SOAPHeader header = soapFactory.createSOAPHeader();
    envelope.addChild(header);

    OMNamespace synNamespace = soapFactory.createOMNamespace(
        "http://ws.apache.org/ns/synapse", "syn");
    OMElement clientIDElement = soapFactory.createOMElement("ClientID", synNamespace);
    clientIDElement.setText(clientID);
    header.addChild(clientIDElement);

    SOAPBody body = soapFactory.createSOAPBody();
    envelope.addChild(body);

    OMElement valueElement = soapFactory.createOMElement("Value", null);
    valueElement.setText(value);
    body.addChild(valueElement);

    return envelope;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:24,代码来源:LoadBalanceSessionFullClient.java

示例2: buildSoapEnvelope

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
private SOAPEnvelope buildSoapEnvelope(String clientID, String value) {
    SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();

    SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();

    SOAPHeader header = soapFactory.createSOAPHeader();
    envelope.addChild(header);

    OMNamespace synNamespace = soapFactory.
            createOMNamespace("http://ws.apache.org/ns/synapse", "syn");
    OMElement clientIDElement = soapFactory.createOMElement("ClientID", synNamespace);
    clientIDElement.setText(clientID);
    header.addChild(clientIDElement);

    SOAPBody body = soapFactory.createSOAPBody();
    envelope.addChild(body);

    OMElement valueElement = soapFactory.createOMElement("Value", null);
    valueElement.setText(value);
    body.addChild(valueElement);

    return envelope;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:24,代码来源:LoadbalanceFailoverClient.java

示例3: addAttachmentIDHeader

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
/**
 * Adding the attachment ids iteratively to the SOAP Header
 *
 * @param header           Header Element where the child elements going to be included
 * @param attachmentIDList attachment ids
 */
private void addAttachmentIDHeader(SOAPHeader header, List<Long> attachmentIDList) {
    final String namespace = Constants.ATTACHMENT_ID_NAMESPACE;
    final String namespacePrefix = Constants.ATTACHMENT_ID_NAMESPACE_PREFIX;
    final String parentElementName = Constants.ATTACHMENT_ID_PARENT_ELEMENT_NAME;
    final String childElementName = Constants.ATTACHMENT_ID_CHILD_ELEMENT_NAME;

    OMNamespace omNs = soapFactory.createOMNamespace(namespace, namespacePrefix);
    OMElement headerElement = soapFactory.createOMElement(parentElementName, omNs);

    for (Long id : attachmentIDList) {
        OMElement idElement = soapFactory.createOMElement(childElementName, omNs);
        idElement.setText(String.valueOf(id));

        headerElement.addChild(idElement);
    }

    header.addChild(headerElement);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:25,代码来源:SOAPHelper.java

示例4: addCoordinationContext

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
/**
 * Adding ws-Coordination context to soap request.
 *
 * @param msgCtx              MessageContext
 * @param messageID           UUID as a WS-Coordination identifier
 * @param registrationService URL of the ws-coordination registration service.
 */
public void addCoordinationContext(MessageContext msgCtx, String messageID, String registrationService) {
    SOAPHeader header = msgCtx.getEnvelope().getHeader();
    EndpointReference epr = new EndpointReference();
    epr.setAddress(registrationService);
    CoordinationContext context = new HumanTaskCoordinationContextImpl(messageID, epr);
    header.addChild(context.toOM());
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:15,代码来源:SOAPHelper.java

示例5: 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

示例6: addHeadersToEnvelope

import org.apache.axiom.soap.SOAPHeader; //导入方法依赖的package包/类
/**
 * Add all configured headers to a SOAP envelope.
 *
 * @param envelope the SOAPEnvelope in which to write the headers
 */
public void addHeadersToEnvelope(SOAPEnvelope envelope) {
    if (headers != null) {
        SOAPHeader soapHeader = envelope.getHeader();
        for (Object header : headers) {
            soapHeader.addChild((OMElement)header);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:14,代码来源:ServiceClient.java


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