Thanks Bill,
But my requirement is slight differ. Because my message did not contain
Standard header or tailor tags. I need to validate message without header or
tailor tags. But I think datadictionary validate method need complete
message.
Is there a way?
BR,
Eranga
-----Original Message-----
From: Bill Robert [mailto:rob...@ra...]
Sent: Wednesday, September 06, 2006 12:38 PM
To: Eranga Samararathna
Subject: RE: [Quickfix-developers] Validate Message......
Hi Eranga
I do something similiar in my application and the function doing the
check looks as following:
try
{
FIX::DataDictionary dict(p_session.getDataDictionary());
FIX::Message msg(p_content, dict);
dict.validate(msg); // throws if msg not valid
if(!FIX::Session::sendToTarget( msg ))
LOG(Warn) << "Message accepted but temporarly unable to
transmit:\n" << p_content;
return Answer::Ok;
}
catch( FIX::SessionNotFound& )
{
LOG(Error) << "Session not found";
return Answer::NotFound;
}
catch( FIX::FieldNotFound& e )
{
LOG(Error) << "Tag " << e.field << " not found";
return Answer::BadRequest;
}
catch( FIX::TagNotDefinedForMessage& e )
{
LOG(Error) << "Tag " << e.field << " not defined for message";
return Answer::BadRequest;
}
catch( FIX::InvalidTagNumber& e )
{
LOG(Error) << "Tag " << e.field << " not defined";
return Answer::BadRequest;
}
catch( FIX::IncorrectTagValue& e)
{
LOG(Error) << "Value of tag " << e.field << " is incorrect (out of
range)";
return Answer::BadRequest;
}
catch( FIX::RequiredTagMissing& e )
{
LOG(Error) << "Required tag " << e.field << " missing";
return Answer::BadRequest;
}
Basically in all cases of "BadRequest" I simply give it back to the
originating system, including the text written to LOG(error).
Regards
Robert
> -----Original Message-----
> From: qui...@li...
> [mailto:qui...@li...] On
> Behalf Of Eranga Samararathna
> Sent: Wednesday, September 06, 2006 8:24 AM
> To: qui...@li...;
> qui...@li...
> Subject: [Quickfix-developers] Validate Message......
>
> QuickFIX Documentation:
> http://www.quickfixengine.org/quickfix/doc/html/index.html
> QuickFIX Support: http://www.quickfixengine.org/services.html
>
>
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: 9/5/2006
|