Acessando o Cabeçalho MQRFH2 Utilizando um Nó JavaCompute

Ao construir cabeçalhos MQRFH2 em um nó JavaCompute, existem dois tipos de campo:

O código a seguir inclui um cabeçalho MQRFH2 em uma mensagem de saída, que deve ser utilizada para fazer um pedido de assinatura: Início da mudança
public void addRfh2(MbMessage msg) throws MbException
{
	MbElement root = msg.getRootElement();
	MbElement body = root.getLastChild();

	// insira o novo cabeçalho antes do corpo da mensagem
	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);
}
Fim da mudança
Conceitos relacionados
Visão Geral de Fluxos de Mensagens
Modelagem de Mensagens
Tarefas relacionadas
Projetando um Fluxo de Mensagens
Definindo o Conteúdo do Fluxo de Mensagens
Referências relacionadas
Cabeçalho do MQRFH2
Avisos | Marcas Registradas | Downloads | Biblioteca | Suporte | Feedback
Direitos Autorais IBM Corporation 1999, 2006 Última Atualização: 1 Sep 2006
ac30440_