Ejemplo n.º 1
0
  void RequestApplication::fromApp( const FIX::Message& message, const FIX::SessionID& sessionId )
    throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType )
  {
#ifndef NDEBUG
    if ( message.getHeader().getField( FIX::FIELD::SenderCompID ).find( orderGeneratorId ) == std::string::npos )
    {
      dismantleFIX( "INBOUND", message.toString() ) ;
    }
#endif

    try
    {
      crack( message, sessionId ); 
    }
    catch( std::exception &e )
    {
      FIX42::Reject fixReject;
      fixReject.setField( FIX::FIELD::RefSeqNum, message.getHeader().getField( FIX::FIELD::MsgSeqNum ) ) ;
      fixReject.setField( FIX::FIELD::RefMsgType, message.getHeader().getField( FIX::FIELD::MsgType ) ) ;
      // fixReject.setField( FIX::FIELD::RefTagID,
      fixReject.setField( FIX::FIELD::Text, e.what() ) ;
      // fixReject.setField( FIX::FIELD::SessionRejectReason ( sessionRejectReason ) ) ;
    
      try
      {
        FIX::Session::sendToTarget ( fixReject, sessionId ) ;

      }
      catch ( FIX::SessionNotFound &e )
      {
        std::cout << "Error on Sending execution report " << e.what() << std::endl ;
      }
    }
  }
Ejemplo n.º 2
0
  void RequestApplication::toApp( FIX::Message&message, const FIX::SessionID& )
    throw( FIX::DoNotSend ) 
  {
#ifndef NDEBUG
    if(  message.getHeader().getField( FIX::FIELD::TargetCompID ).find( orderGeneratorId ) == std::string::npos  )
    {
      dismantleFIX( "OUTBOUND", message.toString() ) ;
    }
#endif
  }