本文整理汇总了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));
}
示例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);
}
示例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());
}
}
}