Re: [Quickfix-developers] Re: Problem with 4.4 header fields 627-630
Brought to you by:
orenmnero
|
From: Loic G. <loi...@sw...> - 2005-12-14 22:58:50
|
Hi Caleb,
I am not the one setting those fields. These are getting set ( or enriched)
by the central hub system. This is what I get from the system and as far as
the sequence of the fields go within the messages they do correspond to
header section as defined by the protocol.
I do know how to set header fields and body fields. There is a problem here in
the library I do believe. The problem is in processing the inbound message
which gets rejected by the engine as the 627-630 fields seem to be expected
in the body by the QF library which is wrong.
In fact looking at the code of the DataDictionary.cpp, I believe within the
header section each line is expected to start with the string "field" and
unfortunately the tag 627 "NoHops" is a repeating group and doesn't start
with "field" and therefore doesn't get looked at:
// HEADER
DOMNodePtr pHeaderNode = pDoc->getNode("/fix/header");
if(!pHeaderNode.get())
throw ConfigError(url + ": <header> section not found in data
dictionary");
DOMNodePtr pHeaderFieldNode = pHeaderNode->getFirstChildNode();
if(!pHeaderFieldNode.get()) throw ConfigError(url + ": No header fields
defined");
while(pHeaderFieldNode.get())
{
======> if(pHeaderFieldNode->getName() == "field")
{
DOMAttributesPtr attrs = pHeaderFieldNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError(url + ": <field> does not have a name attribute");
std::string required = "false";
attrs->get("required", required);
addHeaderField(lookupXMLFieldNumber(pDoc.get(), name), required ==
"true");
}
RESET_AUTO_PTR(pHeaderFieldNode, pHeaderFieldNode->getNextSiblingNode());
}
I hope this helps.
Loic Guezennec
On Wednesday 14 December 2005 17.53, Caleb Epstein wrote:
> On 12/13/05, Loic Guezennec <loi...@sw...> wrote:
> > I got around this problem by moving the 627-630 field definition out of
> > the
> > header section into the different message sections in the FIX44.xml.
> > I don't think that's the best way to do it though, so I guess this is a
> > bug
> > really :)
>
> I doesn't look like those fields appeared in the header of the message you
> pasted. They seem to be in the message body. To add fields to the header
> you need to do something like msg.getHeader().setField (ARGS). Using
> msg.setField() will add the field to the body.
>
> --
> Caleb Epstein
> caleb dot epstein at gmail dot com
|