We are developing a client, which has to talk to NAS via the Socket Bus Adapter. The client can - for the moment - send two xml-requests, which it wants to send to the NAS to get the corresponding responses. The 1st request wants to get customer information from the navision system. The request is built as xml data which contains the customer id, for which the information should be returned. The 2nd request wants to book a invoice for a customer in the navision system. This requests is also xml data, which contains the customer no, account information, tax information and so on. The xml requests can have different lenghts but follow the same structure. The client comes as an exe file, which is programmed in C++ and can send and receive xml requests via TCP/IP-sockets. There could be several client processes on one or more PC's, which send their requests often simultaneously against the same NAS. To realize this kind of request/response scenario, we have the following problems/questions:
a) Who has experiences in such a scenario with simultaneous requests against NAV? Are there known drawbacks / critical issues?
b) The requests can have different lengths? How can the socket bus adapter recognize the end of any request? We believe that the property "BytesToRead" isn't appropriate for my purpose? The use of the property "ReceivingTimeout" cannot set to 0, because the length of the xml can reach a size where transport of consecutive packets is possible; whereas a high value of this property can slow down the processing of multiple requests for a given time.
c) For booking of invoices we want to take the codeunit "Gen. Jnl.-Post". We have seen that this codeunit uses MESSAGE-calls and the WINDOW-object. This cannot work within the processing in NAS or can it (who presses for example the OK button)?
d) We use SQL-Server as our database? What about deadlock situations when the NAS books invoices and people book invoices from their Navision Client applications?
e) Perhaps for load balancing it is necessary to take several NAS instances on one or more PC's. Does anyone has experiences in solutions with more than one NAS? Who dispatches the work (requests) for the available NAS?
](*,)
And finally we cannot wait for NAV 5.1 ...
Thanks for your help.
0
Comments
Yes, the requests can be any XML etc. How to read the message, you can read in some examples e.g. http://msmvps.com/blogs/kine/archive/20 ... 00987.aspx, if you are partner...
The message and error is writing into eventlog. The window variable cannot be used and the commands using it must be conditioned by "if GUIALLOWED".
Keep in mind, that NAS is just a client without GUI. In this case it will behive as normal client and will reise error. What it will do with NAS depends on more things (way, how the CU is called, if the timer is used etc.)
You need to do some dispatcher. For example, you can insert the request into one queue, which is read by NAS and this NAS forward the message into other queue for processing. This target queue can be changed after each message to send first message to NAS1, second to NAS2 etc. in circle.
Edited: And sorry, after I wrote it I found, that you are talking about Socket bus and I am talkig about Microsoft Message Queues. :oops:
But may be something will inspire you...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I have to study your "inspirations". Some are independent of the choosen bus adapter. But with MessageQueues you don't have the problem to determine the end of each request. With the SBA you have :?
Do you know also a good docu for SBA?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I believe that the decision about the bus adapter isn't so important. Maybe we use also MSMQ. The base problem for all e-commerce applications which integrates with Navision seems to be the fact, that all "traffic" is handled by the NAS (CG/CP/EP/Webshop also use the NAS - that's right isn't it?), And the NAS works strictly sequential. Imagine a web shop where 20 customers enter their customer id to fetch their data from navision. Then these 20 requests run to NAS and are serialized. One by one get the corresponding response. Say that the 5th request blocks in a database operation (recCustomer.GET( '4711'). All the other requests have to wait until the block is over or a timeout occurs (is it possible to set a timeout for each GET operation?). It's difficult for me to imagine that "real" e-commerce applications can work in an acceptable manner with this sequential behavour. How do other developers face this problem? ](*,)
Thanks in advance.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.