QuickFix - Tag not defined for this message - Celer tech - quickfix

I've seen this questioned asked before here
and have applied the suggested solution but am still coming up with
Tag not defined for this message
I'm sending this message :
toapp : 8=FIX.4.4|9=151|35=V|34=2|49=Test|52=20180731-14:35:54.947|56=UAT-Test|55=EUR/USD|63=SP|115=Username|167=FOR|207=XCEL|262=1|263=1|264=0|265=0|461=SPOT|10=074|
and getting this back
toadmin : 8=FIX.4.4|9=134|35=3|34=3|49=Test|52=20180731-14:35:54.982|56=UAT-Test|45=2|58=Tag not defined for this message type|371=264|372=W|373=2|10=090|
The entry in the data dictionary for marketdatarequest is :
<message name="MarketDataRequest" msgtype="V" msgcat="app">
<field name="MDReqID" required="Y"/>
<field name="SubscriptionRequestType" required="Y"/>
<field name="MarketDepth" required="Y"/>
<field name="Symbol" required="Y"/>
<field name="SecurityType" required="Y"/>
<field name="MDUpdateType" required="Y"/>
<field name="CFICode" required="Y"/>
<field name="SettlType" required="Y"/>
<field name="OnBehalfOfCompID" required="N"/>
<field name="SecurityExchange" required="Y"/>
</message>
...
<field number="264" name="MarketDepth" type="INT"/>
All the other FIX implementations I've come across also have NoMDEntryTypes and NoRelatedSym groups which this does not which is strange but this is what the spec requires.
Also am I correct in saying that if I send an toapp message and get the toadmin message back with no fromapp/fromadmin message, does that mean quickfix intercepted the message as incorrectly formed and never sent it?

The rejection is not for your market data request. I can tell this from tag 372=W in the rejection:
FIX 4.4 : RefMsgType <372> field
The MsgType <35> (35) of the FIX message being referenced.
Source
MsgType W refers to a market data snapshot.
From the information you've given, I can infer that you send a MarketDataRequest (35=V) which presumably works successfully. The server you're connecting to replies with a snapshot (35=W) and your FIX engine then automatically responds to them with a rejection, because their snapshot includes tag 264 which are you not expecting.

Related

Wrong values in Interim Accounts when returning stock

I am using anglo saxon accounting ​method in my accounting and I use average pricing as my costing method in inventory. But I am struggling with the vendor stock returning process because after validating the return, stock interim account values are not as I expected. I want to return the stock to the vendor to the price of what bought but it returned to the current price.
https://www.odoo.com/documentation/user/12.0/accounting/others/inventory/avg_price_valuation.html
As the above link says, Odoo can cater stock returns to their purchase price (see section: “Further thoughts on anglo saxon mode”). But I run the same test case on my server (Odoo 12) as well as the Odoo demo server, but it returns to the current price.
Is there any specific configuration for enabling this process or am I doing something wrong?
all you need to do is inherit view_company_form view and add anglo_saxon_accounting field
<record id="view_company_form_inherit" model="ir.ui.view">
<field name="name">res.company.form.inherit</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[#name='rml_header1']" position="after">
<separator string=""/>
<group >
<field name="anglo_saxon_accounting" />
</group>
</xpath>
</field>
</record>

ejabberd BOSH search brings nothing

We're trying to switch from Openfire to ejabberd XMPP server.
I have ejabberd installed with default options on my local Windows 10 workstation.
I set
mod_vcard:
search: true
I registered a couple of users using ejabberd ReST API. I also set some vcard values for those users (my understanding is that vcard entries are necessary for ejabberd search to work, correct?)
Using Postman, I can confirm that there are vcards for user "testfouoles":
POST http://localhost:5281/api/get_vcard
Body:
{
"host": "planetrisk.com",
"user": "testfouoles",
"name": "FN"
}
Response:
{
"content": "Test UnclassifiedFouoLes"
}
Besides FN, EMAIL, NICKNAME, and NICK vcards are set. vcards seems to be case-sensitive, so I set both small lettters and capital letters variants, because I'm not sure which variants are used by search. I also set vcard2 values for N FAMILY and N GIVEN.
For Openfire, we were using CandyJs with a custom Search plugin. For now we continue to use it with ejabberd.
For test purposes, I set
mod_vcard:
search: true
allow_return_all: true
This way, search operations with empty input fields return all users who added some information to their vCard (according to ejabberd docs).
Our CandyJS Search plugin issues the following POST request to ejabberd BOSH listener:
Request URL:http://localhost:5443/bosh?b=101
Request Method:POST
Status Code:200 OK
Remote Address:127.0.0.1:5443
...
Request Payload
<body rid='55271928' xmlns='http://jabber.org/protocol/httpbind' sid='5633a7a6184041b173970798227fddadea5e8742'>
<iq type='set' id='search2' to='vjud.planetrisk.com' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field var='first'><value/></field>
<field var='last'><value/></field>
<field var='nick'><value/></field>
<field var='email'><value/></field>
<field var='fn'><value/></field>
</x>
</query>
</iq>
</body>
And ejabberd responds with vcard data of the only registered user (besides the requesting user):
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xml:lang='en' to='army.dudeFOUO(at)everbridge.mil#planetrisk.com/planetrisk_Candy_b4a02de8' from='vjud.planetrisk.com' type='result' id='search2' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x type='result' xmlns='jabber:x:data'>
<title>Search Results for vjud.planetrisk.com</title>
<reported>
<field var='jid' type='text-single' label='Jabber ID'/>
<field var='fn' type='text-single' label='Full Name'/>
<field var='first' type='text-single' label='Name'/>
<field var='middle' type='text-single' label='Middle Name'/>
<field var='last' type='text-single' label='Family Name'/>
<field var='nick' type='text-single' label='Nickname'/>
<field var='bday' type='text-single' label='Birthday'/>
<field var='ctry' type='text-single' label='Country'/>
<field var='locality' type='text-single' label='City'/>
<field var='email' type='text-single' label='Email'/>
<field var='orgname' type='text-single' label='Organization Name'/>
<field var='orgunit' type='text-single' label='Organization Unit'/>
</reported>
<item>
<field var='jid'><value>testfouoles#planetrisk.com</value></field>
<field var='fn'><value>Test UnclassifiedFouoLes</value></field>
<field var='last'><value>UnclassifiedFouoLes</value></field>
<field var='first'><value>Test</value></field>
<field var='middle'><value/></field>
<field var='nick'><value>testfouoles</value></field>
<field var='bday'><value/></field>
<field var='ctry'><value/></field>
<field var='locality'><value/></field>
<field var='email'><value>testfouoles#planetrisk.com</value></field>
<field var='orgname'><value/></field>
<field var='orgunit'><value/></field>
</item>
</x>
</query>
</iq>
</body>
Everything works fine so far. Now, if I submit a search request with non-empty search criteria, regardless of having allow_return_all: true or false, search does not find anything:
Request Payload
<body rid='839156118' xmlns='http://jabber.org/protocol/httpbind' sid='39d0d2e120960757f97eeb15488ba6820b509bf7'>
<iq type='set' id='search2' to='vjud.planetrisk.com' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field var='first'><value>UnclassifiedFouoLes</value></field>
<field var='last'><value>UnclassifiedFouoLes</value></field>
<field var='nick'><value>UnclassifiedFouoLes</value></field>
<field var='email'><value>UnclassifiedFouoLes</value></field>
<field var='fn'><value>UnclassifiedFouoLes</value></field>
</x>
</query>
</iq>
</body>
Here I tried to search for "UnclassifiedFouoLes" which is the correct value of N FAMILY. I tried to search for correct email, nick, etc - nothing works. ejabberd returns an empty result.
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xml:lang='en' to='army.dudeFOUO(at)everbridge.mil#planetrisk.com/planetrisk_Candy_0d46391c' from='vjud.planetrisk.com' type='result' id='search2' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x type='result' xmlns='jabber:x:data'>
<title>Search Results for vjud.planetrisk.com</title>
<reported>
<field var='jid' type='text-single' label='Jabber ID'/>
<field var='fn' type='text-single' label='Full Name'/>
<field var='first' type='text-single' label='Name'/>
<field var='middle' type='text-single' label='Middle Name'/>
<field var='last' type='text-single' label='Family Name'/>
<field var='nick' type='text-single' label='Nickname'/>
<field var='bday' type='text-single' label='Birthday'/>
<field var='ctry' type='text-single' label='Country'/>
<field var='locality' type='text-single' label='City'/>
<field var='email' type='text-single' label='Email'/>
<field var='orgname' type='text-single' label='Organization Name'/>
<field var='orgunit' type='text-single' label='Organization Unit'/>
</reported>
</x>
</query>
</iq>
</body>
So, why doesn't ejabberd find users by correctly supplied (?) search terms which matches vcard values? What am I doing wrong?
I'm stuck. I cannot find any additional ejabberd documentation on Jabber Search. I don't understand how standard vcard field names correspond to standard Jabber Search field names (or maybe Data Forms field names?).
The same CandyJS Search plugin issues very similar request to Openfire XMPP server and gets results. The only difference is that Openfire requires some non-standard additions to search request payload to specify in which fields to search in:
<field var='Username'><value>1</value></field>
<field var='Name'><value>1</value></field>
<field var='Email'><value>1</value></field>
And Openfire returns results with an additional
<field var="FORM_TYPE" type="hidden"/>
clause. Does it give any clue?
I'm stuck and really appreciate pointing me to the right direction.
Update:
Actually, here is the first question:
When we send the following search request to XMPP server
<body rid='839156118' xmlns='http://jabber.org/protocol/httpbind'
sid='39d0d2e120960757f97eeb15488ba6820b509bf7'>
<iq type='set'id='search2' to='vjud.planetrisk.com' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field var='first'><value>UnclassifiedFouoLes</value></field>
<field var='last'><value>UnclassifiedFouoLes</value></field>
<field var='nick'><value>UnclassifiedFouoLes</value></field>
<field var='email'><value>UnclassifiedFouoLes</value></field>
<field var='fn'><value>UnclassifiedFouoLes</value></field>
</x>
</query>
</iq>
</body>
Are search conditions combined by "OR" or by "AND"?
Do we search for a user who has any of field values ('first', 'last', 'nick', email', 'fn') equal to 'UnclassifiedFouoLes' or all the fields equal?
Update 2:
I'm trying to send a simple request (one without <x xmlns='jabber:x:data' type='submit'>) from Postman to ejabberd:
<body rid='1106091871' xmlns='jabber.org/protocol/httpbind' sid='2afabe5b07c316685e25a2d407617a534ca6b2bb'>
<iq type='set' id='search2' to='vjud.planetrisk.com' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'><last>UnclassifiedFouoLes</last></query>
</iq>
</body>
The result is always empty - it doesn't return any items. And there is a user with "last" vCard = "UnclassifiedFouoLes".
Why is it? Is "from" clause in request required?
Two existing clients can see each other and communicate in chat. But when I login as client1, grab sid and rid, insert them into Postman post, result is empty like
<body xmlns='http://jabber.org/protocol/httpbind' sid='67c6c7ee389a99e3491bbeab9ab198766ffa5ca8' rid='1287825358'>
<iq xmlns='jabber:client' type='set' id='search2' to='vjud.planetrisk.com'>
<query xmlns='jabber:iq:search'>
<last>UnclassifiedFouoLes</last>
</query>
</iq>
</body>
Simple type of search (one without <x xmlns="jabber:x:data" type="submit">) somehow returned error.
For extended search, it turned out, I was not sending
<field type="hidden" var="FORM_TYPE"><value>jabber:iq:search</value></field>
clause. That omission was working fine against Openfire, ejabberd requires it.
Still, Openfire Search plugin provides convenience and efficiency which I didn't find in ejabberd: it allows a chat client to display one search box and then to search for the value user typed in several fields (search OR functionality). On a client side, you need to send search request like
<body rid='273260412' xmlns='http://jabber.org/protocol/httpbind' sid='961w8ipmo2'>
<iq type='set' id='search2' to='yourSearchDomain.com' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field var='search'><value>your_search_term</value></field>
<field var='Username'><value>1</value></field>
<field var='Name'><value>1</value></field>
<field var='Email'><value>1</value></field>
</x>
</query>
</iq>
</body>
Openfire Search plugin would interpret this request as a command to perform three search requests: to find users with Username which matches your_search_term, then to find users with Name matching, and with Email matching. All three search results would be combined using logical OR.
Client only needs to send one Http search request to Openfire to search for your_search_term in three fields. With ejabberd, client would need to send three Http requests...
It would be nice to implement similar functionality in ejabberd module...

quickfix: How to know whether a fid is in a group or not?

Let's assume there is such part in quickfix's data dictionary
<message name="Name" msgtype="type">
<field name="field1" required="Y"/>
<field name="field2" required="Y"/>
<field name="field3" required="N"/>
<group name="group1" required="Y">
<field name="field4" required="Y"/>
</group>
<group name="group2" required="Y">
<field name="field5" required="Y"/>
<field name="field6" required="N"/>
</group>
</message>
While sending request, I need to construct message correctly - set field5 in group2, field4 in group1, and field1 outside of any group. Is there a way in quickfix library to know, for example, if field4 is in a group or not? And in which group?
If not, how is it possible to use quickfix library, if you are depending on data dictionary client will use? I should force clients to configure data dictionary as I configured it?
I should force clients to configure data dictionary as I configured it?
Yes. A server ("acceptor") and its clients ("initiators") should all be using the same DataDictionary.
If you are providing a server, you should provide documentation that defines exactly what messages/fields you support, and how use use those messages and fields. If you don't provide a QuickFIX data dictionary file, you should provide sufficient information so that client firms can create one.
Is there a way in quickfix library to know, for example, if field4 is in a group or not? And in which group?
I think you are asking this question because you don't really know what you're doing yet. :)
I think there might be DD methods for this, but I can't really remember because they're not something people usually need. I don't think this is the right approach for whatever your problem is.

Add user defined fields in the FIX dictionary

I need to add/modify fields in the FIX4.4 dictionary. I haven't found any helpful documentation or tutorials on this.
I'm guessing I have to modify the FIX44.xml file, but I'm not sure how exactly to do that.
In the <message></message> tags I don't see any attributes that define the number or the type(format) of that field. I see just the name and required attributes.
I think I found attributes I', looking for in the <fields></fields> tags.
I'm not sure if I'm looking in the right place or if I'm doing the right thing, but according to this I should modify the dictionary if it is necessary.
Please help.
A link to a tutorial for beginners that can help me would also be greatly appreciated.
The FIX Data Dictionary in QuickFIX contains Messages and Fields (among other things).
To add Messages you must add the message between the <messages></messages> tags like this:
<message name="CoolMessage" msgcat="app" msgtype="xCM">
<field name="Currency" required="N"/>
<field name="Text" required="N"/>
<field name="Account" required="Y"/>
</message>
And then add the new msgtype to the MsgType field in the <fields></fields> section like this:
<field number='35' name='MsgType' type='STRING'>
...
<value enum='xCM' description='COOLMESSAGE'/>
</field>
If you want to add new fields, just add them between the <fields></fields> tags like this:
<fields>
<field number="1" name="Account" type="STRING"/>
<field number="2" name="AdvId" type="STRING"/>
<field number="3" name="AdvRefID" type="STRING"/>
...
<field number="9006" name="AwesomeField" type="STRING"/>
</fields>
This and more information can be found in this tutorial.

FIX 4.2 and ExecReportAck

we have a counterparty that implement FIX 4.2 standard to send executionReport messages (35=8).
In their specifications, they need a message in order to check the correct transmission. The strange thing is that the message type is "BN", that's not in 4.2 specs.
I've implemented a method in order to send such kind of message, and all works fine, but the quickfix put this message into the errorlog.
There is a way to tell quickfix to exclude from errorlog these "BN" messages?
Try editing the DataDictionary. I would create a new file. And set the DataDictionary location to the new file in your quickfix config file.
In the XML file for the data dictionary add an additional Message Type that to match what your counter party is sending you.
In the Message Type field:
<field number="35" name="MsgType" type="STRING">
add a line something like this:
<value enum="BN" description="MESSAGE_TYPE_NAME" />
where MESSAGE_TYPE_NAME is the correct description
Then add a type
<message name="ExecutionReportAck" msgtype="BN" msgcat="app">
<field name="OrderID" required="Y"/>
<field name="SecondaryOrderID" required="N"/>
<field name="ClOrdID" required="N"/>
...
</message>