Accesso all'intestazione MQRFH2 utilizzando un nodo JavaCompute

Quando vengono create intestazioni MQRFH2 in un nodo JavaCompute, esistono due tipi di campi:

Il seguente codice aggiunge un'intestazione MQRFH2 a un messaggio in uscita da utilizzare per effettuare una richiesta di sottoscrizione: Inizio modifica
public void addRfh2(MbMessage msg) throws MbException
{
	MbElement root = msg.getRootElement();
	MbElement body = root.getLastChild();

	// insert new header before the message body
	MbElement rfh2 = body.createElementBefore("MQHRF2");

	rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Version", new Integer(2));
	rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Format", "MQSTR");
	rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "NameValueCCSID", new Integer(1208));

	MbElement psc = rfh2.createElementAsFirstChild(MbElement.TYPE_NAME, "psc", null);
	psc.createElementAsFirstChild(MbElement.TYPE_NAME, "Command", "RegSub");
	psc.createElementAsFirstChild(MbElement.TYPE_NAME, "Topic", "department");
	psc.createElementAsFirstChild(MbElement.TYPE_NAME, "QMgrName", "QM1");
	psc.createElementAsFirstChild(MbElement.TYPE_NAME, "QName", "PUBOUT");
	psc.createElementAsFirstChild(MbElement.TYPE_NAME, "RegOpt", "PersAsPub");

	MbXPath xp [equals char] new MbXPath("/MQMD/Format" + "[set-value(´MQHRF2´)]", root);
	root.evaluateXPath(xp);
}
Fine modifica
Concetti correlati
Panoramica dei flussi di messaggi
Creazione di modelli di messaggio
Attività correlate
Progettazione di un flusso di messaggi
Definizione del contenuto del flusso di messaggi
Riferimenti correlati
Intestazione MQRFH2
Informazioni particolari | Marchi | Download | Libreria | Supporto | Commenti
Copyright IBM Corporation 1999, 2006 Ultimo aggiornamento: ago 17, 2006
ac30440_