@Override public String toString() { return DOMUtils.domToString(_element); }
/** * Serialization routines. * * @see Serializable */ private void writeObject(java.io.ObjectOutputStream out) throws IOException { out.writeObject(DOMUtils.domToString(e)); } }
public static byte[] domToBytes(Element element) { String stringifiedElement = domToString(element); return (stringifiedElement != null) ? stringifiedElement.getBytes() : null; }
public void writeVariable(String variableName, Node value) throws FaultException { variables.put(variableName, value); System.out.println("Storing in " + variableName + ": " + DOMUtils.domToString(value)); }
public void set(Node node) { if (node.getNamespaceURI().equals(SERVICE_REF_QNAME.getNamespaceURI())) _eprElmt = DOMUtils.getFirstChildElement((Element) node); else _eprElmt = (Element) node; if (__log.isDebugEnabled()) __log.debug("Setting a WSAEndpoint value: " + DOMUtils.domToString(_eprElmt)); }
public EndpointReference resolveEndpointReference(Element element) { if (log.isDebugEnabled()) { log.debug("Resolving endpoint reference " + DOMUtils.domToString(element)); } return EndpointFactory.createEndpoint(element); }
public Object getSimpleContent(Node simpleNode, QName type) { String text = simpleNode.getTextContent(); Object o = convertSimpleTypeToSaxon(type, text); if (__log.isDebugEnabled()) { __log.debug("getSimpleContent for " + DOMUtils.domToString(simpleNode) + " " + type + " returned " + o); } return o; } }
private static String nodeToString(XmlDataDAO xml){ Node data = xml.get(); String str; if (data == null) { str = null; } else if (data.getNodeType() == Node.ELEMENT_NODE) { str = DOMUtils.domToString(data); } else { str = data.getNodeValue(); } return str; } }
public String getUrl() { Element port = (Element) _serviceElmt.getElementsByTagNameNS(Namespaces.WSDL_11, "port").item(0); // get soap:address Element address = (Element) port.getElementsByTagNameNS(Namespaces.SOAP_NS, "address").item(0); // ... or the http:address if (address == null) { address = (Element) port.getElementsByTagNameNS(Namespaces.HTTP_NS, "address").item(0); } // ... or the soap12:address if (address == null) { address = (Element) port.getElementsByTagNameNS(Namespaces.SOAP12_NS, "address").item(0); } if (address == null) { throw new IllegalArgumentException("soap:address and http:address element in element " + DOMUtils.domToString(_serviceElmt) + " is missing or in the wrong namespace."); } return address.getAttribute("location"); }
public void replyWithFailure(FailureType type, String description, Element details) throws BpelEngineException { if (LOG.isDebugEnabled()) { String msg = new StringBuilder("replyWithFailure mex=").append(getMessageExchangeId()) .append(" failureType=").append(type) .append(" description=").append(description) .append(" details=").append(details==null?null:DOMUtils.domToString(details)) .toString(); LOG.debug(msg); } boolean isAsync = isAsync(); setFailure(type, description, details); if (isAsync) continueAsync(); }
Node initializeVariable(BpelRuntimeContext context, VariableInstance var, Node value) throws ExternalVariableModuleException { if (var.declaration.extVar != null) /* external variable */ { if (__log.isDebugEnabled()) __log.debug("Initialize external variable: name="+var.declaration + " value="+DOMUtils.domToString(value)); VariableInstance related = resolve(var.declaration.extVar.related); Node reference = null; try { reference = fetchVariableData(context, related, true); } catch (FaultException fe) { // In this context this is not necessarily a problem, since the assignment may re-init the related var } if (reference != null) value = context.readExtVar(var.declaration, reference); return value; } else /* normal variable */ { if (__log.isDebugEnabled()) __log.debug("Initialize variable: name="+var.declaration + " value="+DOMUtils.domToString(value)); return context.writeVariable(var, value); } }
public void writeEndpointReference(PartnerLinkInstance variable, Element data) throws FaultException { if (__log.isDebugEnabled()) { __log.debug("Writing endpoint reference " + variable.partnerLink.getName() + " with value " + DOMUtils.domToString(data)); } PartnerLinkDAO eprDAO = fetchPartnerLinkDAO(variable); eprDAO.setPartnerEPR(data); }
private Future invokeBPELProcessThroughODEMessageExchange( final MyRoleMessageExchange odeMessageExchange, final BPELMessageContext bpelMessageContext) throws AxisFault { Message request = createInputMessageToODE(bpelMessageContext, odeMessageExchange); if (log.isDebugEnabled()) { log.debug("Invoking ODE using MEX " + odeMessageExchange); log.debug("Message content: " + DOMUtils.domToString(request.getMessage())); } return odeMessageExchange.invoke(request, bpelMessageContext.getAttachmentIDList()); }
Node writeVariable(BpelRuntimeContext context, VariableInstance var, Node value) throws ExternalVariableModuleException { if (var.declaration.extVar != null) /* external variable */ { if(__log.isDebugEnabled()) __log.debug("Write external variable: name="+var.declaration + " value="+DOMUtils.domToString(value)); VariableInstance related = resolve(var.declaration.extVar.related); Node reference = null; try { reference = fetchVariableData(context, related, true); } catch (FaultException fe) { // In this context this is not necessarily a problem, since the assignment may re-init the related var } ValueReferencePair vrp = context.writeExtVar(var.declaration, reference, value); writeVariable(context, related, vrp.reference); return vrp.value; } else /* normal variable */ { if(__log.isDebugEnabled()) __log.debug("Write variable: name="+var.declaration + " value="+DOMUtils.domToString(value)); return context.writeVariable(var, value); } }
/** * Called when the response for the above service received * * @param mexId MessageExchange id */ public void onRequestReceived(String mexId) throws FaultException { _log.info("Response received"); //((ExtensionContextImpl)extensionContext).setBpelRuntimeContext(context); Element notificationMessageEle = extensionContext.getInternalInstance().getMyRequest(mexId); Node part = extensionContext.getPartData(notificationMessageEle, longRunningActivity.getOutputVariable()); _log.info("RESPONSE: " + DOMUtils.domToString(notificationMessageEle)); _log.info("PART: " + DOMUtils.domToString(part)); extensionContext.writeVariable(longRunningActivity.getOutputVariable(), part); extensionContext.complete(cid); }
private Message createResponseMessage(PartnerRoleMessageExchange partnerRoleMessageExchange, Operation operation, Element invocationResult) { Document dom = DOMUtils.newDocument(); String operationName = operation.getName(); Part bpelOperationOutputPart = (Part)((WSDLInterface)operation.getInterface()).getPortType().getOperation(operationName, null, null) .getOutput().getMessage().getParts().values().iterator().next(); Element contentMessage = dom.createElement("message"); Element contentPart = dom.createElement(bpelOperationOutputPart.getName()); contentPart.appendChild(dom.importNode(invocationResult, true)); contentMessage.appendChild(contentPart); dom.appendChild(contentMessage); if(__log.isDebugEnabled()) { __log.debug("Creating result message:"); __log.debug(">>>" + DOMUtils.domToString(dom.getDocumentElement())); } QName id = partnerRoleMessageExchange.getOperation().getOutput().getMessage().getQName(); Message response = partnerRoleMessageExchange.createMessage(id); response.setMessage(dom.getDocumentElement()); return response; }
/** * Get Variable data for the given variable name, for this scope instance * @param varName Variable Name * @return DOM Node as XML String. If no value exists or variable not initialized, NULL will be returnrd. */ public String getVariableData(String varName) { String value = null; try { Variable var = __scope.getVisibleVariable(varName); VariableInstance varInstance = new VariableInstance(__scopeInstanceId, var); Node varNode = __runtimeContext.readVariable(varInstance.scopeInstance, varInstance.declaration.name, false); value = DOMUtils.domToString(varNode); } catch(Throwable e) { //Don't throw any exception back to the caller. Just return null as value. } return value; }
public AnswerResult fetchAnswer(QName service, String operation, Element outgoingMessage, Date currentEventDateTime) { __log.debug("fetching answer for " + service + " " + operation); ServiceConfig cfg = getServiceConfig(service); if (cfg.getReplayType().isSetMock()) { String key = getAnswersKey(service, operation); AnswersForKey v = answersMap.get(key); Exchange e = v == null ? null : v.answerPos < v.answers.size() ? v.answers.get(v.answerPos) : null; if (e == null) { throw new IllegalStateException("answer for " + service + " " + operation + " at time " + currentEventDateTime + " not found, outgoing message was " + DOMUtils.domToString(outgoingMessage)); } v.answerPos++; __log.debug("fetched " + e); return new AnswerResult(false, e); } else if (cfg.getReplayType().isSetMockQuery()) { return new AnswerResult(false, fetchMockQuery(service, operation, outgoingMessage, cfg)); } else if (cfg.getReplayType().isSetLive()) { return new AnswerResult(true, null); } else assert(false); return null; }
public Object validate(Expression arg0, OVarType rootNodeType, Object requestedResultType) throws CompilationException { __log.debug("validate " + arg0 + " type: " + rootNodeType + " requestedResultType:" + requestedResultType); if (arg0 instanceof Query) { Query q = (Query) arg0; node = q.getExpression(); initPrefixMap(); resolvePrefixes(node); return generateExpression(DOMUtils.domToString(q.getExpression()), q, rootNodeType, requestedResultType); } else if (arg0 instanceof Expression) { Expression e = (Expression) arg0; node = e.getExpression(); initPrefixMap(); resolvePrefixes(node); return generateExpression(DOMUtils.domToString(e.getExpression()), e, rootNodeType, requestedResultType); } return null; }
@Override public void reply(PartnerLinkInstance plinkInstnace, String opName, String mexId, Element msg, QName fault) throws FaultException { String mexRef = _imaManager.release(plinkInstnace, opName, mexId); if (mexRef == null) { throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest); } MessageExchangeDAO mex = _dao.getConnection().getMessageExchange(mexRef); String pipedId = mex.getPipedMessageExchangeId(); if (pipedId != null) { __log.debug("instance replied for live communication:" + mexRef + " " + DOMUtils.domToString(msg)); super.reply2(plinkInstnace, opName, mexId, msg, fault, false, mexRef); } else { MessageDAO message = mex.createMessage(plinkInstnace.partnerLink.getMyRoleOperation(opName).getOutput().getMessage().getQName()); buildOutgoingMessage(message, msg); __log.debug("instance replied mexRef:" + mexRef + " " + DOMUtils.domToString(msg)); mex.setResponse(message); mex.setStatus(Status.RESPONSE.toString()); } }