本文整理汇总了Java中org.apache.axiom.soap.SOAPEnvelope.getOMFactory方法的典型用法代码示例。如果您正苦于以下问题:Java SOAPEnvelope.getOMFactory方法的具体用法?Java SOAPEnvelope.getOMFactory怎么用?Java SOAPEnvelope.getOMFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axiom.soap.SOAPEnvelope
的用法示例。
在下文中一共展示了SOAPEnvelope.getOMFactory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invoke
import org.apache.axiom.soap.SOAPEnvelope; //导入方法依赖的package包/类
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
try {
if (ENABLE.equals(System.getProperty(UDDI_SYSTEM_PROPERTY))) {
SOAPEnvelope envelope = msgContext.getEnvelope();
OMNamespace namespace = envelope.getNamespace();
String nameSpace = namespace.getNamespaceURI();
if (nameSpace != null) {
log.info("first " + envelope.getBody().getFirstElementNS().getNamespaceURI());
log.info(envelope.toString());
if (envelope.getBody().getFirstElementNS().getNamespaceURI().equals(UDDI_V2)) {
OMFactory omFactory = envelope.getOMFactory();
OMElement firstElement = envelope.getBody().getFirstElement();
setNamespace(firstElement, omFactory.createOMNamespace(UDDI_V3,
firstElement.getNamespace().getPrefix()));
}
log.info("second " + envelope.getBody().getFirstElementNS().getNamespaceURI());
log.info(envelope.toString());
}
}
} catch (Exception e) {
log.error("An error occurred while processing SOAP message.", e);
}
return InvocationResponse.CONTINUE;
}
示例2: createElement
import org.apache.axiom.soap.SOAPEnvelope; //导入方法依赖的package包/类
/**
* Creates a new <code>ebint:RoutingInput</code> element in the context of the given SOAP envelope using the data
* form the given User Message.
* <p>NOTE: The element is not added to the SOAP envelope by this method! This done later by the WS-A module as the
* created element will be added as a EPR parameter.
*
* @param soapEnv The SOAP envelope the <code>RoutingInput</code> element must be added to
* @param routinginfo The User Message data that is the routing info
* @return A new <code>ebint:RoutingInput</code> element
*/
public static OMElement createElement(final SOAPEnvelope soapEnv, final IUserMessage routinginfo) {
final OMFactory f = soapEnv.getOMFactory();
// Create the RoutingInput element
final OMElement routingInput = f.createOMElement(Q_ELEMENT_NAME);
routingInput.declareNamespace(EbMSConstants.EBMS3_NS_URI, EbMSConstants.EBMS3_NS_PREFIX);
// And add a regular UserMessage child to it
final OMElement usrMsgElem = UserMessageElement.createElement(routingInput, routinginfo);
// This UserMessage element however has incorrect namespace, so change it to the multi-hop namespace
usrMsgElem.setNamespace(routingInput.getNamespace());
return routingInput;
}